Search

Find a component, token or page

Base · Overlays

Sheet

A panel that slides in from an edge of the screen over the page.

HTML / JSPlannedReactStableReact NativeDraftSwift (SwiftUI)PlannedGodotPlannedVueDraftSvelteDraftSolidDraft
Reviewed

Props

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

<Sheet>
  <SheetTrigger render={<Button variant="outline" />}>Edit stop</SheetTrigger>
  <SheetContent>
    <SheetHeader>
      <SheetTitle>Edit stop</SheetTitle>
      <SheetDescription>Update the delivery window and contact for this stop.</SheetDescription>
    </SheetHeader>
    <div className="px-4">{/* fields */}</div>
    <SheetFooter>
      <SheetClose render={<Button />}>Save changes</SheetClose>
      <SheetClose render={<Button variant="outline" />}>Cancel</SheetClose>
    </SheetFooter>
  </SheetContent>
</Sheet>

Overview

A sheet is a dialog attached to a screen edge. It keeps the page visible behind it, which suits tasks that relate to what the user was looking at: editing a row, filtering a list, reading details.

When to use

  • To view or edit a record without leaving the list it came from.
  • For filters, settings or a secondary form that is too long for a popover.
  • For navigation that is hidden on small screens (the Sidebar uses a sheet on mobile).

When not to use

  • For a short, focused task that deserves the user's full attention: use a Dialog.
  • To confirm a destructive action: use an Alert dialog.
  • On touch screens where the panel should be swiped away: use a Drawer.
  • For a few fields anchored to a control: use a Popover.

Anatomy

  1. Backdrop

    Dims the page. Clicking it closes the sheet.

  2. Content

    The panel. Left and right sheets are full height and up to 24rem wide; top and bottom sheets are full width and as tall as their content.

  3. Header

    Title and optional description.

  4. Body

    Your content. Add your own padding and scrolling.

  5. Footer

    Actions, pinned to the end of the panel.

  6. Close button

    An icon button in the top corner. Hide it with showCloseButton when the footer has a cancel action.

Props

The contract every language implements. Names follow each language’s conventions (camelCase in React, snake_case in Rust).

PropTypeDefaultDescription
side"right" | "left" | "top" | "bottom"rightThe edge the sheet is attached to. Set on SheetContent.
showCloseButtonbooleantrueShows the close icon button in the top corner.
titlestringEdit stopHeading of the sheet. Passed as children of SheetTitle.
descriptionstringUpdate the delivery window and contact for this stop.Supporting text under the title.
openboolean–Controlled open state, set on the root.
onOpenChangefunction–Called when the sheet opens or closes.

States

Closed
Only the trigger is rendered.
Open
The panel slides in from its edge and the backdrop fades in. Focus moves into the panel.
Closing
The panel slides back and focus returns to the trigger.

Accessibility

Role: dialog

KeysAction
Enter/SpaceOn the trigger, opens the sheet.
Tab/Shift+TabMoves between the controls inside the sheet. Focus does not leave it.
EscapeCloses the sheet and returns focus to the trigger.
  • Always include a SheetTitle; hide it visually with sr-only if the design has no heading.
  • The page behind is inert and does not scroll while the sheet is open.
  • The close button has the accessible name “Close”.

Design tokens

Change any of these in Foundations and this component follows, in every language.

Platform notes

HTML / JS
Planned
Not built in HTML / JS yet.
React
Stable
Matches the contract with no platform differences.
React Native
Draft
A bottom sheet with a grab handle on phones; on wide windows (600pt and up) `side` attaches it to that edge. Pass a `trigger` element, or control it with `open` and `onOpenChange`.
Swift (SwiftUI)
Planned
Not built in Swift yet.
Godot
Planned
Not built in Godot yet.
Vue
Draft
Usage snippet only; triggers and close buttons use as-child in place of React's render prop.
Svelte
Draft
Usage snippet only (Svelte 5); triggers and close buttons take button classes instead of React's render prop.
Solid
Draft
Usage snippet only; triggers and close buttons use the as prop in place of React's render prop.

Related