codefast/ui

Command Palette

Search for a command to run...

Overlay

Sheet

Side-anchored panel (left, right, top, or bottom). Useful for settings and detail drawers.

Install

pnpm add @codefast/ui

Import path

@codefast/ui/sheet

Examples

No Close Button

Use showCloseButton={false} on SheetContent to hide the close button.

RTL

Right-to-left layout support for languages such as Arabic and Hebrew.

Translations are AI-generated for demonstration and may be imperfect.

Side

Use the side prop on SheetContent to set the edge of the screen where the sheet appears. Values are top, right, bottom, or left.

Anatomy

How the parts compose. Copy this skeleton and fill in the slots.

import {
  Sheet, SheetTrigger, SheetContent,
  SheetHeader, SheetTitle, SheetDescription,
  SheetBody, SheetFooter, SheetClose,
} from "@codefast/ui/sheet";

<Sheet>
  <SheetTrigger asChild>…</SheetTrigger>
  <SheetContent side="right">
    <SheetHeader><SheetTitle>…</SheetTitle></SheetHeader>
    <SheetBody>…</SheetBody>
    <SheetFooter><SheetClose>…</SheetClose></SheetFooter>
  </SheetContent>
</Sheet>

API reference

Props for each part of the component. All native element props are also forwarded.

Sheet

Root. Manages open state (a Dialog under the hood).

PropTypeDefaultDescription
open / onOpenChangeboolean / (open: boolean) => voidControl visibility from your own state.
defaultOpenbooleanfalseOpen on mount when uncontrolled.

SheetContent

PropTypeDefaultDescription
side"top" | "right" | "bottom" | "left""right"Which edge the panel slides in from.

Accessibility

Built to be keyboard-navigable and screen-reader friendly out of the box.

KeyFunction
SpaceOpens the sheet when the trigger is focused.
TabCycles focus within the sheet (focus is trapped).
EscCloses the sheet and restores focus to the trigger.
  • A Sheet is a Dialog: focus is trapped and the background is inert while open.
  • Always provide a SheetTitle so the panel has an accessible name.
  • Use a Sheet for side tasks; use a Drawer (Vaul) for mobile bottom-sheet gestures.

Guidelines

Conventions that keep usage consistent across an app.

Do

  • Use for secondary tasks — filters, details, quick edits.
  • Anchor navigation sheets to the left, content/detail sheets to the right.

Don’t

  • Don’t put a multi-step primary flow in a sheet — use a page.
  • Don’t stack a sheet over a dialog.