Talisman LogoTalisman Logo Design System
Browse documentation
Components

Sheet

A modal panel that slides in from any edge of the page, for filters, forms and details that should not take the user to another page.

Stableimport { Sheet } from "@repo/ui/sheet";Source

Select the button to open the panel. Use the corner ×, the footer or Escape to close it.

When to use

  • For a filter panel next to a list: the user keeps the list in view and applies the filters.
  • For a short form or a detail view that belongs to the current page, such as a court fee detail.
  • For a navigation menu on narrow widths, opening from the left.

When not to use

  • A decision that needs a yes or no. Use Dialog or Alert dialog.
  • Read-only details of the selected row. Use a Drawer, which scrolls and is always on the right.
  • A list of actions. Use Dropdown menu.
  • Long, multi-step tasks. Use a page. The sheet does not scroll, so tall content is cut off.

Which one to use

Component Opens from Closes with Scrolls Use for
Dialog Center Corner ×, Escape, backdrop click No Short tasks, confirmations
Alert dialog Center Footer buttons, Escape No Irreversible actions
Drawer Right only DrawerClose, Escape, backdrop click Yes Details of the selected item
Sheet Any edge Corner ×, Escape, backdrop click No Filters, forms, navigation

Sheet and Drawer

Both are modal side panels and both are built on Radix Dialog, so focus handling and Escape match. They differ in what the source adds:

  • Sheet uses Radix Dialog directly. side places it on the right (default), left, top or bottom. It has a corner × button, 24px of padding and sm:max-w-sm (384px) width. It does not scroll.
  • Drawer wraps Vaul, a gesture library on top of Radix Dialog. It always renders as a 384px (w-96) panel on the right, scrolls vertically, and has no built-in close button and no padding. The wrapper sets handleOnly and exports no handle, so there is no swipe to close.

Pick the Sheet when the user fills something in or when the panel opens from another edge. Pick the Drawer for read-mostly details.

Anatomy

Part Role
Sheet Holds the open state.
SheetTrigger The element that opens it. Use asChild with a Button.
SheetContent The panel, its backdrop and the corner ×. Takes side.
SheetHeader Groups the title and the description.
SheetTitle Names the panel. Required for assistive technology.
SheetDescription One sentence of context.
SheetFooter The actions. Supporting action first, main action last.
SheetClose Closes the sheet. Use asChild on the cancel button.

Examples

Side panel with fields

Sides

side chooses the edge. Use right for filters and details, left for navigation. top and bottom span the full width.

Without the corner button

Content

  • Title the panel with the object or the task: “Filtrar tarefas”, “Detalhes da taxa judicial”.
  • Put the apply or save action in the footer, with “Cancelar” before it.
  • Keep content short enough to fit without scrolling.

Accessibility

  • Built on Radix Dialog: focus moves into the panel on open, stays inside it, and returns to the trigger on close. Escape closes it and the page behind is inert.
  • The content has role="dialog" and is labelled by SheetTitle and described by SheetDescription. Always include both. Radix warns in development when they are missing.
  • The corner × is a button with a screen-reader-only “Close” label. The label is hardcoded in English (see Known issues).
  • If you use hideCloseButton, the footer must always offer a way to close.
  • hideOverlay removes the backdrop only. The sheet is still modal and the page behind is still inert, so it can mislead sighted users.

Code

import { Button } from "@repo/ui/button";
import {
  Sheet,
  SheetClose,
  SheetContent,
  SheetDescription,
  SheetFooter,
  SheetHeader,
  SheetTitle,
  SheetTrigger,
} from "@repo/ui/sheet";

<Sheet>
  <SheetTrigger asChild>
    <Button variant="secondary">Filtrar tarefas</Button>
  </SheetTrigger>
  <SheetContent side="right">
    <SheetHeader>
      <SheetTitle>Filtrar tarefas</SheetTitle>
      <SheetDescription>
        Os filtros valem para a lista que você está vendo.
      </SheetDescription>
    </SheetHeader>
    <SheetFooter>
      <SheetClose asChild>
        <Button variant="secondary">Cancelar</Button>
      </SheetClose>
      <Button variant="primary">Aplicar filtros</Button>
    </SheetFooter>
  </SheetContent>
</Sheet>;

Props

Sheet
PropTypeDefaultDescription
defaultOpenbooleanfalseInitial open state when the sheet is uncontrolled
modalbooleantrueBlocks interaction with the rest of the page while open
onOpenChange(open: boolean) => void—Called when the sheet opens or closes
openboolean—Controlled open state
SheetContent
PropTypeDefaultDescription
side"top" | "right" | "bottom" | "left""right"Edge the panel slides in from.
hideCloseButtonbooleanfalseHides the corner × button.
hideOverlaybooleanfalseDoes not render the backdrop. The sheet stays modal.
overlayClassNamestring—Extra class for the backdrop.
onEscapeKeyDown(event: KeyboardEvent) => void—Called when `Escape` is pressed. Call `event.preventDefault()` to keep the sheet open.
SheetTrigger, SheetClose
PropTypeDefaultDescription
asChildbooleanfalseRenders the child element instead of a button, for SheetTrigger and SheetClose.

Known issues

Issue Effect
The backdrop is bg-black/80, a translucent fill. The repository avoids transparency in UI.
The corner × is h-4 w-4 with no padding and opacity-70. The hit target is 16px, below the 24px minimum, and the control is translucent until hovered.
The × label is a hardcoded Close, with no closeLabel prop (the Dialog has one). Apps cannot translate it, so Portuguese pages announce an English label.
The × uses ring-offset-background. The Tailwind config only defines old-background. The class generates nothing, so the focus ring offset falls back to Tailwind’s default, white.
SheetContent has no overflow-y-auto or max height. Content taller than the viewport is cut off and cannot be scrolled.
SheetTitle uses text-lg font-semibold instead of Typography. The title does not follow the type scale tokens.
Edit this page on GitHub