Skip to content

Sheet

⋯

Sheet is a right-side modal panel built on Base UI Dialog. Add your own header controls, content, and actions inside it.

Import Sheet from @nesra/ui/sheet or the package root.

Sheet
├─ Sheet.Trigger
└─ Sheet.Content
├─ Sheet.Header
│ ├─ Sheet.Title
│ ├─ Sheet.Description (optional)
│ └─ Sheet.Close
├─ your content
└─ Sheet.Footer (optional)

Sheet.Content creates the portal and a dimmed, blurred backdrop. It slides in from the right with a default width of 400px and a maximum width of the viewport minus 24px. Motion is disabled when the user prefers reduced motion. The panel scrolls when its contents exceed the viewport; Sheet.Header stays visible at the top. Set className on Sheet.Content for another width, such as w-[928px].

Compose application state and footer buttons. The example applies the current query when the user chooses Apply filter.

Applied: none

size="compact" renders the form sheet header from the Finance Master Data designs. Place Sheet.Title, Sheet.Description, and an icon-only Sheet.Close directly inside Sheet.Header.

Detail default compact
Padding 16px; 24px from sm 24px inline, 16px block
Gap between children 8px 4px
Bottom divider border-nesra-stroke-divider None
Title from sm type-nesra-body-large-semibold type-nesra-body-medium-semibold
Icon-only Sheet.Close box 36px, in the header’s flow 24px, pinned 16px from the top and 24px from the end
End padding with close Set by your layout 68px when Sheet.Close is a direct child, leaving 20px before the close

The Ads comparison design uses a 928px panel with a two-row header and no footer. The table in this example is application content.

The panel scrolls vertically when content exceeds the viewport height. Its header stays visible while scrolling.

Pass open and onOpenChange when the application needs to observe or change disclosure from outside the sheet.

State: closed

initialFocus targets the name field. The application validates, saves, and closes after submission; Cancel closes without saving.

Saved project: none

disablePointerDismissal prevents a backdrop press from closing the sheet. Escape and the close controls still work.

Place other interactive primitives inside the sheet. The dropdown selection stays in application state.

The Filters slideout menu in Figma uses a 400px panel for filter controls. The Ads comparison sheet uses a 928px panel with a two-row header and table, without a footer. Both open from the right. Content and width belong to each use case; neither set of fields is part of the Sheet API.

The backdrop matches the Figma Filters slideout: --nesra-foundation-bg-overlay at 70% opacity with backdrop-blur-nesra-md (16px). The overlay is near-black in both modes, so the page behind the sheet dims in Dark as well as Light. The panel, header, and footer use --nesra-surface-card-bg-neutral; Sheet.Description uses --nesra-text-support.

  • Sheet.Title names the dialog. Include it for every sheet. Sheet.Description supplies optional supporting text.
  • Base UI Dialog traps focus, makes the rest of the page inert, locks page scrolling, and returns focus to the trigger after closing. Keyboard opening focuses the first focusable control. Pointer and touch opening focus the panel; a custom initialFocus overrides this behavior.
  • Escape, an outside press, or Sheet.Close closes the sheet. An icon-only Sheet.Close renders an X with the accessible label Close panel. Text or custom controls can be supplied through children or render.
  • In a compact header, the icon-only close has a 24px visible box and a 40px pointer target, which exceeds the WCAG 2.5.8 minimum of 24 by 24 CSS pixels. Custom close controls keep their own size and position.
  • The application owns form state, validation, and whether footer actions apply or discard changes. Use open and onOpenChange for a controlled sheet.
Part Props Effect
Sheet Base UI Dialog root props, including open, defaultOpen, onOpenChange, modal Manages disclosure and focus. Modal by default.
Sheet.Trigger Base UI Dialog trigger props Opens the sheet. render composes an existing button.
Sheet.Content Base UI Dialog popup props Creates portal, backdrop, and right-side panel. className sets width. initialFocus and finalFocus can override focus targets.
Sheet.Header Native div props, plus size: "default" (default) or "compact" Optional header region that stays visible while the panel scrolls. size sets header density, title type, and icon-only close.
Sheet.Footer Native div props Optional footer region.
Sheet.Title, Sheet.Description Base UI Dialog title and description props Accessible name and description.
Sheet.Close Base UI Dialog close props Closes on activation. Defaults to an X icon and Close panel label. In a compact header, the icon-only close is pinned.

The package also exports SheetHeaderSize ("default" | "compact") for wrappers that forward size.