# Sheet

> A panel that slides in from any edge of the window.

- Category: [Overlays](https://tarve.dev/docs.md#overlays)
- Import: `import { Sheet } from "@tarve/core";`
- Props type: `SheetProps`
- Source: [packages/core/src/extra-controls.ts:786](https://github.com/omarcosr/tarve/blob/main/packages/core/src/extra-controls.ts#L786)

## Usage

```tsx title="Sheet.tsx"
import { Button, Sheet, Switch } from "@tarve/core";

let open = true;
let compact = false;

<>
  <Button variant="outline" onClick={() => (open = true)}>
    Preferences
  </Button>
  <Sheet
    open={open}
    side="right"
    title="Preferences"
    onOpenChange={(next) => {
      open = next;
    }}
  >
    <Switch label="Compact mode" checked={compact} onCheckedChange={(value) => (compact = value)} />
  </Sheet>
</>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `open` (required) | `boolean` | — |  |
| `closeOnEscape` | `boolean` | `true` |  |
| `closeOnOverlay` | `boolean` | `true` |  |
| `description` | `string` | — |  |
| `footer` | `Child` | — |  |
| `onOpenChange` | `(open: boolean) => void` | — |  |
| `showClose` | `boolean` | `true` |  |
| `side` | `SheetSide` | `"right"` |  |
| `size` | `Style["width"]` | `400` |  |
| `title` | `string` | — |  |

## Common props

Shared by every component (descriptions: https://tarve.dev/docs.md#common-props): `children`, `class`, `className`, `highlight`, `id`, `key`, `motionFrom`, `onHighlight`, `onPaste`, `onPointerLeave`, `onPointerMove`, `onSize`, `onTransitionEnd`, `rovingGroup`, `style`.

## Types

```ts title="SheetSide"
type SheetSide = "left" | "right" | "top" | "bottom";
```

Previous: [AlertDialog](https://tarve.dev/docs/components/AlertDialog.md) · Next: [Drawer](https://tarve.dev/docs/components/Drawer.md)

---

Tarve v0.13.8 · HTML version: https://tarve.dev/docs/components/Sheet · Index for agents: https://tarve.dev/llms.txt
