Overlays

Sheet

Side-anchored panel. Use for navigation, filters, or lightweight detail views.

Preview
01 Installation

Install

Pull Sheet from the barrel for everyday use, or the granular path when you want a tighter bundle.

tsxBarrel1 line
import { Sheet } from "@brika/clay";
tsxGranular1 line
import { Sheet } from "@brika/clay/components/sheet";
02 Usage

A minimal example

Drop this into a page. Native HTML attributes pass through to the underlying primitive.

tsxSheet.tsx38 lines
import { Button } from '@brika/clay/components/button';
import {
  Sheet,
  SheetClose,
  SheetContent,
  SheetDescription,
  SheetFooter,
  SheetHeader,
  SheetTitle,
  SheetTrigger,
} from '@brika/clay/components/sheet';
/** Right-side sheet (default), suited for filters, detail views, and settings panels. */
export default function SheetDefaultDemo() {
  return (
    <Sheet>
      <SheetTrigger asChild>
        <Button variant="outline">Open filters</Button>
      </SheetTrigger>
      <SheetContent>
        <SheetHeader>
          <SheetTitle>Filters</SheetTitle>
          <SheetDescription>
            Narrow the results using the controls below.
          </SheetDescription>
        </SheetHeader>
        <div className="flex-1 px-4 py-6 text-muted-foreground text-sm">
          Filter controls go here.
        </div>
        <SheetFooter>
          <SheetClose asChild>
            <Button variant="outline">Reset</Button>
          </SheetClose>
          <Button>Apply</Button>
        </SheetFooter>
      </SheetContent>
    </Sheet>
  );
}
03 Examples

Sheet, every way

Form

Sheet with a form, useful for quick data entry without navigating away.

Left

Left-side sheet, commonly used as an off-canvas navigation panel.

04 Accessibility

Accessibility

  • Focus is trapped inside the sheet while open.
  • Escape dismisses the sheet and returns focus to the trigger.
  • SheetTitle is required for an accessible name, use sr-only to visually hide it if the design omits a heading.
  • The side prop ("top", "right", "bottom", "left") does not affect AT semantics.
05 Tokens 16 theme-overridable

Theme tokens

Every CSS variable Sheet reads, with its default and the dotted path you'd write in a ThemeConfig JSON to override it. Set any of these in your theme to retune Sheet without touching component code.

Sheet tokens

16 tokens
ColorFill, border, and text colors.7
  • --sheet-surface-containercolorvar(--popover)
    components.sheet.surfaceContainer

    Background of the sliding sheet surface.

  • --sheet-surface-labelcolorvar(--popover-foreground)
    components.sheet.surfaceLabel

    Default foreground color inside the sheet.

  • --sheet-title-colorcolorvar(--foreground)
    components.sheet.titleColor

    Foreground color of the sheet title.

  • --sheet-description-colorcolorvar(--muted-foreground)
    components.sheet.descriptionColor

    Foreground color of the sheet description text.

  • --sheet-close-active-containercolorvar(--secondary)
    components.sheet.closeActiveContainer

    Background of the built-in close-X button when its data-state is open.

  • --sheet-close-ring-colorcolorvar(--ring)
    components.sheet.closeRingColor

    Focus ring color of the built-in close-X button.

  • --sheet-close-ring-offset-colorcolorvar(--background)
    components.sheet.closeRingOffsetColor

    Focus ring offset color of the built-in close-X button (matches the surface behind the sheet, so the offset reads as a gap).

GeometrySizes, lengths, and corner radii.3
  • --sheet-padding-xsizecalc(var(--spacing) * 6)
    components.sheet.paddingX

    Inline padding inside the sheet.

  • --sheet-padding-ysizecalc(var(--spacing) * 6)
    components.sheet.paddingY

    Block padding inside the sheet.

  • --sheet-gapsizecalc(var(--spacing) * 4)
    components.sheet.gap

    Gap between adjacent children inside the sheet.

BorderBorder width and style.2
  • --sheet-border-widthborder-width1px
    components.sheet.borderWidth

    Border width on the sheet. Set non-zero for outline-style variants.

  • --sheet-border-styleborder-stylesolid
    components.sheet.borderStyle

    Border style on the sheet (`solid`, `dashed`, `double`, `none`).

ElevationDrop shadow and depth.2
  • --sheet-shadowshadowvar(--shadow-modal)
    components.sheet.shadow

    Sheet elevation.

  • --sheet-backdrop-blurblur0px
    components.sheet.backdropBlur

    Backdrop blur applied behind a translucent sheet.

MotionAnimation duration and easing.2
  • --sheet-durationdurationvar(--motion-standard-duration)
    components.sheet.duration

    Transition duration for sheet state changes.

  • --sheet-easingeasingvar(--motion-standard-easing)
    components.sheet.easing

    Transition easing for sheet state changes.

Override in a theme

Authoring a theme is plain JSON. Drop overrides under components.sheet, the names are camelCase versions of the variable suffix.

jsonmy-theme.json12 lines
{
  "id": "my-theme",
  "name": "My Theme",
  "description": "...",
  "accentSwatches": ["#000"],

  "components": {
    "sheet": {
      "paddingX": "calc(var(--spacing) * 6)"
    }
  }
}

Then apply with applyTheme(myTheme) (see the theming guide), scope it to a subtree with themeToCssVars(myTheme, mode), or consume any token directly in your own JSX with the matching Tailwind utility (e.g. bg-sheet-…) — see the chips on each token row.

06 API reference

API reference

Props specific to Sheet. Native HTML attributes pass through to the underlying primitive, see the component source on GitHub for the full type signature.

<Sheet />

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

<SheetClose />

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

<SheetContent />

2 props
  • showCloseButtondefault true
    boolean
    Render the built-in close X.
  • sidedefault 'right'
    'top' | 'right' | 'bottom' | 'left'
    Which edge the sheet slides in from.

<SheetDescription />

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

<SheetFooter />

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

<SheetHeader />

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

<SheetOverlay />

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

<SheetPortal />

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

<SheetTitle />

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

<SheetTrigger />

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.