Overlays & Actions
Sheet
Sheet extends Dialog to render content from a viewport edge. Reveal the right amount of context without losing the user's place in the interface. Keep the trigger, content and dismissal behavior working as one interaction. Import it from @/components/kamod-ui/sheet.
Source · Design reference · API reference · Theming · Styles
Interactive preview
Preact example Local preview theme · Responsive styles follow the preview widthFull widthInstallation
Import Sheet primitives from @/components/kamod-ui/sheet. Motion is optional — core SheetContent includes CSS slide animations.
pnpm add @kamod-ch/uiCopy an example with @kamod-ch/ui or the matching @kamod-ch/ui/… subpath. The code block switches between those two installs. Connect The Global Theme CSS and Tailwind Source Detection before your first render.
Usage
Use SheetTrigger to open and SheetContent with side="top" | "right" | "bottom" | "left". Left and right panels accept max-width utilities; top and bottom span the viewport width. Bottom/top padding includes safe-area insets for notched devices.
import { Sheet } from "@kamod-ch/ui";Choose a complete composition from the examples below; required child components and props vary by pattern.
Component Examples & Variants
Explore Sheet in Different Contexts, from the starting pattern to the compositions below. Begin with Basic, then compare the examples that match your content, state and layout. These are working patterns to adapt, not a list of interchangeable variant values: check the API Reference before using a prop or combining behaviors. Look at the surrounding labels, supporting text and spacing as well as the component itself.
Read the Result and Its Implementation Together. Use each showcase’s Code view to inspect imports and composition, or its Prompt view to prepare a setup or adaptation brief. Try the narrow preview and local theme controls before connecting real data, and use Reset to return an example to its initial state. Keep layout changes in class utilities where appropriate; follow the Component Styles Guide for hierarchy and the Theming Guide for shared surfaces and colors. The Accessibility Notes explain what to preserve when making those changes.
Basic
Keep a Focused Task Beside the Page. Open Sheet with a clear title and description to provide temporary context beside the main page. The edge panel can support a focused task while preserving the reader's sense of the screen behind it.
Open and dismiss the preview with the keyboard, checking that focus returns to a sensible trigger. If the task grows into a long, multi-step workflow, consider a dedicated page instead of making the temporary panel increasingly dense.
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, SheetTrigger } from "@kamod-ch/ui";
export const Example = () => (
<Sheet>
<SheetTrigger>Open</SheetTrigger>
<SheetContent side="right" class="max-w-md">
<SheetHeader>
<SheetTitle>Edit profile</SheetTitle>
<SheetDescription>
Make changes to your profile here. Click save when you're done.
</SheetDescription>
</SheetHeader>
<div class="stack">
<Label for="sheet-name">Name</Label>
<Input id="sheet-name" value="@peduarte" />
</div>
<SheetFooter>
<Button>Save changes</Button>
</SheetFooter>
</SheetContent>
</Sheet>
);Side
Match the Edge to the Available Reading Space. Set side on SheetContent to choose the panel's edge. Top and bottom sheets span the viewport width, while left and right sheets can use maximum-width utilities appropriate to their content.
Test long content and short viewports for every supported direction; width utilities suitable for a right sheet may make a bottom sheet feel unexpectedly narrow.
Interactive preview
Preact example Local preview theme · Responsive styles follow the preview widthFull widthProps and Data
Configure Sheet using the contracts below. Read the documented options alongside the Source Definitions to understand which values your application supplies and which details the component owns. Start with a prop or helper, then follow its type link to inspect the declaration without leaving the page.
Props, slots and variants for this component.
Type cards are extracted from this checkout’s TypeScript source at build time. Props inherited through HTMLAttributes, Omit or variant helpers remain references in those declarations; their fields are not flattened here. Match the reference to your installed version, and check a package’s exports before writing an import type. A type exported by a source file is not necessarily re-exported by @kamod-ch/ui.
Component Props
? means a field can be omitted; it does not promise a fallback value. Existing documented defaults remain alongside the descriptions. For callbacks, check the argument and return types before connecting your own state or services.Sheet
SheetProps
| Prop / type | Description |
|---|---|
children | Configure
|
defaultOpen | Configure
|
dismissible | When false, Escape and an overlay click leave the dialog open. An explicit close control still closes it. Default true.
|
lockBodyScroll | When true, locks document scroll while open (shadcn default).
|
onOpenChange | Configure
|
open | Configure
|
SheetClose
DialogCloseProps
| Prop / type | Description |
|---|---|
asChild | Configure
|
children | Configure
|
data-slot | Configure
|
onClick | Configure
|
ref | Configure
|
SheetContent
SheetContentProps
| Prop / type | Description |
|---|---|
children | Configure
|
class | Configure
|
data-slot | Configure
|
forceMount | Configure
|
showCloseButton | Configure
|
side | Configure
|
SheetDescription
DialogDescriptionProps
| Prop / type | Description |
|---|---|
children | Configure
|
class | Configure
|
id | Configure
|
SheetHeader
SheetHeaderProps
| Prop / type | Description |
|---|---|
children | Configure
|
SheetTitle
DialogTitleProps
| Prop / type | Description |
|---|---|
children | Configure
|
class | Configure
|
id | Configure
|
SheetTrigger
DialogTriggerProps
| Prop / type | Description |
|---|---|
asChild | Configure
|
children | Configure
|
data-slot | Configure
|
onClick | Configure
|
onPointerDown | Configure
|
ref | Configure
|
Data Type Reference
Expand a card to inspect and copy the exact declaration. The code header identifies its repository file; follow imported or inherited types in the Implementation Source when you need the complete dependency chain. Required-field summaries cover fields declared directly in that type. Source-only helpers and inferred schema outputs describe the local implementation, not additional props you can pass to every component.
Sheet Props
1 declared fieldSheetPropsSheet.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of SheetProps before adapting it.SheetContent Props
5 declared fieldsSheetContentPropsSheetContent.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of SheetContentProps before adapting it.SheetFooter Props
1 declared fieldSheetFooterPropsSheetFooter.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of SheetFooterProps before adapting it.SheetHeader Props
1 declared fieldSheetHeaderPropsSheetHeader.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of SheetHeaderProps before adapting it.Accessibility
Build the Complete Interaction, Including the Parts Outside Sheet. The notes below distinguish the current implementation from the labels, content and behavior your application supplies. Start with the Live Preview, check the Props and Data Reference, and test the finished composition with real content rather than assuming that an unchanged visual example covers every use case.
Built-in Behavior and Defaults
SheetContent renders a modal dialog surface with title/description relationships and a named Close sheet control. Its side placement changes presentation, not the need for a meaningful dialog name and a complete keyboard flow.
Labels and Relationships
Use SheetTitle to identify the panel, such as Account settings, and a description when the task needs context. Name close and secondary actions clearly. A mobile navigation sheet still needs its own title even when the links inside are familiar.
Keyboard and Focus
Check opening, initial focus, contained Tab order and dismissal in the actual layout. Keep the final action reachable when content is taller than the viewport. After closing, focus should return to a visible trigger or another intentional destination.
States and Integration Details
Avoid rendering a desktop panel and a mobile sheet as two simultaneously focusable copies. Do not cover the close action with a fixed header or footer, and preserve label IDs when responsive composition changes.
Verify the Complete Interaction
Check Behavior as Well as Markup. Work through these scenarios in the application where the component will be used. Automated checks can help find structural problems; also review the reading experience with a screen reader, keyboard focus and the actual feedback from your application.
- Open and dismiss on both wide and narrow screens with focus clearly visible.
- Traverse a long sheet at enlarged text size and reach every action without escaping behind it.
- Resize while open and check that no duplicate dialog, stale body lock or lost focus remains.
Recheck the result after changing Theme Tokens, translations or class overrides. Include text enlargement, narrow layouts and reduced-motion settings where animation is present. Inspect the Component Source when a behavior differs from your expectation; a role or state attribute does not implement keyboard interaction by itself.
For background, read the WAI-ARIA Authoring Guidance and Keyboard Interface Guidance. These explain the patterns; verify browser and assistive-technology behavior for the implementation and audience you actually support.
You have the pieces. Put them into one real interaction, keep its state in one place, and check the result with the content your application will actually show.
Connect the Foundation
Return to Choose and Compose Components to connect this reference to a working screen. Keep global CSS in one entrypoint and import only the components that screen needs.
Build the Surrounding Screen
Find a neighboring interaction in the Component Library, or start with a complete Block. Replace sample content and destinations before refining the layout; a local class change can stay with the composition.
Make the Result Hold Up
Use shared theme roles for changes that belong everywhere. Then review the whole journey: keyboard focus, long labels, narrow screens and a clear way to recover when something fails.
Keep a link to the source and note your intentional changes. Your next edit should begin with a clear decision, not another search.