# Sheet

A modal panel attached to a viewport edge.

A modal panel attached to a viewport edge.

<p className="zenos-base-ui-source">
  Backed by <a href="https://base-ui.com/react/components/dialog">Base UI Dialog</a> for upstream
  behavior and configuration. Zenos owns the public API, styling, and composition shown on this
  page.
</p>

```tsx
import { Button, Field, Input, Select, Sheet, Stack } from "@zentara-co/zenos-ui";

function SheetExample() {
  return (
    <Sheet.Root>
      <Sheet.Trigger variant="primary">Open settings</Sheet.Trigger>
      <Sheet.Content>
        <Sheet.Header>
          <Sheet.Title>Workspace settings</Sheet.Title>
          <Sheet.Description>Update workspace preferences.</Sheet.Description>
        </Sheet.Header>
        <Stack gap="4" className="py-2">
          <Field.Root>
            <Field.Label>Workspace name</Field.Label>
            <Input defaultValue="Security operations" />
          </Field.Root>
          <Field.Root>
            <Field.Label>Default environment</Field.Label>
            <Select.Root defaultValue="production">
              <Select.Trigger>
                <Select.Value />
              </Select.Trigger>
              <Select.Content>
                <Select.Item value="production">Production</Select.Item>
                <Select.Item value="staging">Staging</Select.Item>
              </Select.Content>
            </Select.Root>
          </Field.Root>
        </Stack>
        <Sheet.Footer>
          <Sheet.Close>Cancel</Sheet.Close>
          <Button>Save changes</Button>
        </Sheet.Footer>
      </Sheet.Content>
    </Sheet.Root>
  );
}
```

## Import

```tsx
import { Sheet } from "@zentara-co/zenos-ui";
```

## Sides

Sheets attach to any viewport edge. Prefer `inline-start` or `inline-end` for detailed tasks and navigation so the attachment follows the reading direction; `inline-end` is the default. Use `left` or `right` only when the edge is intentionally physical. Use top or bottom for shorter, horizontally oriented workflows.

```tsx
import { Sheet, Stack } from "@zentara-co/zenos-ui";

function SheetSidesExample() {
  const sides = ["top", "inline-end", "bottom", "inline-start"] as const;

  return (
    <Stack direction="row" gap="3" wrap="wrap" justify="center">
      {sides.map((side) => (
        <Sheet.Root key={side}>
          <Sheet.Trigger variant="primary" className="capitalize">
            {side}
          </Sheet.Trigger>
          <Sheet.Content side={side}>
            <Sheet.Header>
              <Sheet.Title className="capitalize">{side} sheet</Sheet.Title>
              <Sheet.Description>
                This panel is attached to the {side} edge of the viewport.
              </Sheet.Description>
            </Sheet.Header>
            <Sheet.Footer>
              <Sheet.Close>Done</Sheet.Close>
            </Sheet.Footer>
          </Sheet.Content>
        </Sheet.Root>
      ))}
    </Stack>
  );
}
```

## Controlled state

Use `open` with `onOpenChange` when application state must respond to every opening and closing path, including the trigger, Close controls, Escape, and allowed outside interaction.

```tsx
import { Checkbox, Label, Sheet, Stack, Text } from "@zentara-co/zenos-ui";
import { useState } from "react";

function SheetControlledExample() {
  const [open, setOpen] = useState(false);

  return (
    <Stack gap="3" align="start">
      <Sheet.Root open={open} onOpenChange={setOpen}>
        <Sheet.Trigger variant="primary">Manage filters</Sheet.Trigger>
        <Sheet.Content side="inline-start">
          <Sheet.Header>
            <Sheet.Title>Asset filters</Sheet.Title>
            <Sheet.Description>Limit results by environment and status.</Sheet.Description>
          </Sheet.Header>
          <Stack gap="3" className="py-2">
            <Label className="w-fit">
              <Checkbox defaultChecked />
              Production
            </Label>
            <Label className="w-fit">
              <Checkbox />
              Staging
            </Label>
            <Label className="w-fit">
              <Checkbox />
              Needs review
            </Label>
          </Stack>
          <Sheet.Footer>
            <Sheet.Close variant="primary">Apply filters</Sheet.Close>
          </Sheet.Footer>
        </Sheet.Content>
      </Sheet.Root>
      <Text size="s" color="subtle" aria-live="polite">
        Sheet is {open ? "open" : "closed"}.
      </Text>
    </Stack>
  );
}
```

## Scrollable content

Enable `scrollable` when content may exceed the viewport. Sheet constrains the attached panel and creates an internal scrolling region while keeping the modal focus behavior intact.

```tsx
import { Sheet, Stack, Text } from "@zentara-co/zenos-ui";

function SheetScrollableExample() {
  return (
    <Sheet.Root>
      <Sheet.Trigger variant="primary">Review activity</Sheet.Trigger>
      <Sheet.Content scrollable showCloseButton={false}>
        <Sheet.Header className="mb-4">
          <Sheet.Title>Workspace activity</Sheet.Title>
          <Sheet.Description>Recent security and configuration changes.</Sheet.Description>
        </Sheet.Header>
        <Stack gap="2" className="pt-4">
          {Array.from({ length: 14 }, (_, index) => (
            <div
              key={index}
              className="rounded-md border border-border-default bg-background-neutral-subtle p-3"
            >
              <Text weight="medium">Policy update {index + 1}</Text>
              <Text size="s" color="subtle">
                Updated by a workspace administrator {index + 1} hours ago.
              </Text>
            </div>
          ))}
        </Stack>
        <Sheet.Footer className="mt-6 border-t border-border-default pt-4">
          <Sheet.Close>Done</Sheet.Close>
        </Sheet.Footer>
      </Sheet.Content>
    </Sheet.Root>
  );
}
```

## Content chrome

`Sheet.Content` supplies the portal, backdrop, viewport, popup, edge border, shadow, and close icon. Use `showCloseButton={false}` only when another clearly labeled close action remains available. `showBorder` and `showShadow` can remove elevation treatment for embedded shell compositions.

`Sheet.Overlay` defaults to `forceRender={true}` so its backdrop can render when nested inside another dialog, including a closed sheet. This does not keep a closed sheet mounted. Set `forceRender={false}` on an explicitly composed overlay to use Base UI's default nested-backdrop behavior.

## Variants

side: top, side: inline-end, side: bottom, side: inline-start, side: right, side: left

## Anatomy

```text
Sheet.Root
Sheet.Trigger
Sheet.Content
Sheet.Header
Sheet.Title
Sheet.Description
Sheet.Footer
Sheet.Close
```

## API

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| open | boolean | — | Controlled open state. |
| defaultOpen | boolean | false | Initial uncontrolled state. |
| onOpenChange | (open: boolean) => void | — | Runs when visibility changes. |
| side | top \| inline-end \| bottom \| inline-start \| right \| left | inline-end | Logical or intentionally physical attached viewport edge. |
| showCloseButton / showBorder / showShadow | boolean | true | Built-in content chrome. |
| scrollable | boolean | false | Constrains the panel and enables internal overflow scrolling. |
| forceRender (Overlay) | boolean | true | Allows the backdrop to render inside another dialog, including a closed sheet. |
| closeLabel | string | "Close" | Accessible label for the built-in close icon. |
| Trigger.variant / size | ButtonVariant / sm \| md \| lg | primary / md | Visual treatment for the built-in trigger button. |
| Close.variant / size | ButtonVariant / sm \| md \| lg | outline / md | Visual treatment for an explicit close action. |
| native props | React.Base UI Dialog props | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |

Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.

## Accessibility

Sheet uses Base UI Dialog behavior: focus moves into the panel, remains trapped while modal, and returns to the trigger after closing. Escape closes the sheet unless the interaction is deliberately prevented. Every sheet needs a meaningful `Sheet.Title`; add `Sheet.Description` when the scope or consequence needs explanation. Customize `closeLabel` when “Close” is not specific enough.

Source: https://zenos-ui.pages.dev/components/sheet/