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
Prop
Type
Default
Description
defaultOpen
boolean
false
Initial open state when the sheet is uncontrolled
modal
boolean
true
Blocks interaction with the rest of the page while open
onOpenChange
(open: boolean) => void
—
Called when the sheet opens or closes
open
boolean
—
Controlled open state
SheetContent
Prop
Type
Default
Description
side
"top" | "right" | "bottom" | "left"
"right"
Edge the panel slides in from.
hideCloseButton
boolean
false
Hides the corner × button.
hideOverlay
boolean
false
Does not render the backdrop. The sheet stays modal.
overlayClassName
string
—
Extra class for the backdrop.
onEscapeKeyDown
(event: KeyboardEvent) => void
—
Called when `Escape` is pressed. Call `event.preventDefault()` to keep the sheet open.
SheetTrigger, SheetClose
Prop
Type
Default
Description
asChild
boolean
false
Renders 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.