Install
Pull Sheet from the barrel for everyday use, or the granular path when you want a tighter bundle.
import { Sheet } from "@brika/clay";import { Sheet } from "@brika/clay/components/sheet";A minimal example
Drop this into a page. Native HTML attributes pass through to the underlying primitive.
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>
);
}Sheet, every way
Accessibility
- Focus is trapped inside the sheet while open.
- Escape dismisses the sheet and returns focus to the trigger.
-
SheetTitleis required for an accessible name, usesr-onlyto visually hide it if the design omits a heading. - The
sideprop ("top", "right", "bottom", "left") does not affect AT semantics.
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--sheet-surface-containercolorvar(--popover)components.sheet.surfaceContainerBackground of the sliding sheet surface.
--sheet-surface-labelcolorvar(--popover-foreground)components.sheet.surfaceLabelDefault foreground color inside the sheet.
--sheet-title-colorcolorvar(--foreground)components.sheet.titleColorForeground color of the sheet title.
--sheet-description-colorcolorvar(--muted-foreground)components.sheet.descriptionColorForeground color of the sheet description text.
--sheet-close-active-containercolorvar(--secondary)components.sheet.closeActiveContainerBackground of the built-in close-X button when its data-state is open.
--sheet-close-ring-colorcolorvar(--ring)components.sheet.closeRingColorFocus ring color of the built-in close-X button.
--sheet-close-ring-offset-colorcolorvar(--background)components.sheet.closeRingOffsetColorFocus ring offset color of the built-in close-X button (matches the surface behind the sheet, so the offset reads as a gap).
--sheet-padding-xsizecalc(var(--spacing) * 6)components.sheet.paddingXInline padding inside the sheet.
--sheet-padding-ysizecalc(var(--spacing) * 6)components.sheet.paddingYBlock padding inside the sheet.
--sheet-gapsizecalc(var(--spacing) * 4)components.sheet.gapGap between adjacent children inside the sheet.
--sheet-border-widthborder-width1pxcomponents.sheet.borderWidthBorder width on the sheet. Set non-zero for outline-style variants.
--sheet-border-styleborder-stylesolidcomponents.sheet.borderStyleBorder style on the sheet (`solid`, `dashed`, `double`, `none`).
--sheet-shadowshadowvar(--shadow-modal)components.sheet.shadowSheet elevation.
--sheet-backdrop-blurblur0pxcomponents.sheet.backdropBlurBackdrop blur applied behind a translucent sheet.
--sheet-durationdurationvar(--motion-standard-duration)components.sheet.durationTransition duration for sheet state changes.
--sheet-easingeasingvar(--motion-standard-easing)components.sheet.easingTransition 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.
{
"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.
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 />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<SheetClose />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<SheetContent />
2 props- showCloseButtondefault
truebooleanRender the built-in close X. - sidedefault
'right''top' | 'right' | 'bottom' | 'left'Which edge the sheet slides in from.
<SheetDescription />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<SheetFooter />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<SheetHeader />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<SheetOverlay />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<SheetPortal />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<SheetTitle />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<SheetTrigger />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.