4.2.0
Core

Sheet

A modal panel pinned to one edge of the viewport โ€” for a body of work too big for a dialog and too incidental to deserve a page of its own.

Sheet

A modal panel pinned to the right edge โ€” the default, and the one to reach for when the work is about whatever the reader was already looking at: filters over a list, the detail behind a row. The list stays where it was, so closing the panel returns them to their place rather than to a page they have to find again.

Usage

import {
  Sheet,
  SheetClose,
  SheetContent,
  SheetDescription,
  SheetFooter,
  SheetHeader,
  SheetOverlay,
  SheetPortal,
  SheetTitle,
  SheetTrigger,
} from '@oceanic-hub/brand-system'
<Sheet>
  <SheetTrigger>โ€ฆ</SheetTrigger>
  <SheetContent>
    <SheetHeader>
      <SheetTitle>โ€ฆ</SheetTitle>
      <SheetDescription>โ€ฆ</SheetDescription>
    </SheetHeader>
    <SheetFooter>
      <SheetClose>โ€ฆ</SheetClose>
    </SheetFooter>
  </SheetContent>
</Sheet>

Composition

Use the following composition to build a Sheet:

Sheet
โ”œโ”€โ”€ SheetTrigger
โ””โ”€โ”€ SheetContent
    โ”œโ”€โ”€ SheetHeader
    โ”‚   โ”œโ”€โ”€ SheetTitle
    โ”‚   โ””โ”€โ”€ SheetDescription
    โ””โ”€โ”€ SheetFooter
        โ””โ”€โ”€ SheetClose ร—2

Reach for it when the reader needs room โ€” a set of filters, the detail behind a row, a form of several fields, a menu on a phone โ€” and when what they were looking at should still be there when they close it. That is the trade a sheet makes: it takes the page away like a dialog, but it leaves the page's place intact, so dismissing it is a return rather than a navigation. When the work deserves its own URL, it is a page and this is a detour.

The family it belongs to divides on two questions, and neither is geometry:

  • Can the reader walk away? A sheet, like Dialog, can always be dismissed. When the next click cannot be taken back, that is AlertDialog, which removes every exit that is not a choice.
  • How is it dismissed? Drawer is vaul's bottom sheet: you throw it away with your thumb. A sheet is dismissed deliberately โ€” the X, the scrim, Escape. The interaction is the axis, not the edge, so a bottom sheet is not automatically a Drawer.

And one that is neither: EntityDrawer is not modal at all. It positions against its nearest positioned ancestor so the list beside it stays live. If the reader must deal with the panel before anything else, that is this component; if they should be able to keep scrolling the list, it is that one.

side is the only axis, and each edge carries a meaning a reader has already learned: right is the page's own work, left is navigation, bottom is a thumb's reach, top belongs to the chrome. There is deliberately no width axis โ€” the widths are baked per side so two panels in one product cannot disagree about how wide a drawer is. A surface that genuinely needs another width passes className, which is an explicit override rather than a sanctioned option.

SheetContent is a flex column, so a header, a body and a footer dropped straight into it sit 16px apart with nothing else written. That is worth knowing because it was not true until @OCE-1874: the panel was a block carrying a gap-4 that computed and laid out nothing, and all four demos on this page had written className="flex flex-col" by hand to get the column back. They no longer do. A panel that wants a different arrangement still overrides it through className โ€” the difference is that you are now overriding something rather than supplying it.

SheetTitle is the panel's accessible name, so it is never optional: Radix warns at runtime without one. A design with no visible heading still needs it โ€” keep the element and hide it with sr-only.

Two upstream examples do not come across. showCloseButton={false} belongs to upstream's Base UI generation; here the close is built into SheetContent rather than slotted, because a panel that can be walked away from should say so โ€” there is no showCloseButton prop, though a caller's className can still reach it ([&>button]:hidden), which is what the mobile Sidebar does. And RTL is not supported โ€” a panel whose whole definition is an edge is exactly where an unmeasured right-to-left layout would show, so the refusal is written down in pairings.json under direction rather than left to be found.

Left

side="left" puts the panel where navigation already lives, which is the whole reason to use it: a menu that slides out from the left is read as "more of the app", not as a task. Reach for it for navigation and workspace switching, never for a form.

Bottom

side="bottom" puts the panel within a thumb's reach, so it is the phone arrangement for a short decision. It is height-free โ€” the panel is only as tall as what you put in it โ€” so keep that to a few lines; a bottom sheet that fills the screen has become a page with a scrim behind it.

Top

side="top" drops the panel out of the chrome, so it belongs to whatever the top bar owns โ€” a notification tray, an environment switcher โ€” rather than to the page underneath. It is the rarest of the four: anything the page owns reads better from the right, where it does not push the reader's eye off what they were doing.

API Reference

See the Sheet API page for every prop of every part, with types, defaults and the contract that pins them. It also documents sheetVariants โ€” exported alongside the parts, and signatures rather than props.

On this page