ComponentsMarkdown
Sheet
Edge-anchored modal panel built on Radix Dialog. Slides in from top, right, bottom, or left with radius-xl on the two inner corners only.
Live example
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| Sheet.open / defaultOpen | boolean | — | Controlled or uncontrolled open state on the Sheet root. |
| SheetContent.side | "top" | "right" | "bottom" | "left" | "right" | Viewport edge the sheet anchors to and slides from. |
| SheetContent.container | HTMLElement | null | document.body | Optional portal container element for the sheet itself. |
Sizes and tokens
| Tier / Role | Token | Value |
|---|---|---|
| left / right | w-[min(24rem,calc(100vw-2rem))] / h-full | 384px width · full height · inner radius-xl (24px) |
| top / bottom | max-h-[80vh] / w-full | 80vh max height · full width · inner radius-xl (24px) |
| Surface & layering | --card / --shadow-xl / --z-modal / --z-overlay | 24px padding · z-modal (40) over --overlay scrim (30) |
| Motion | --duration-262 / --duration-162 | Slides from anchored edge (262ms enter, 162ms exit); opacity-only when reduced |
States
Code
import {
Button,
Sheet,
SheetClose,
SheetContent,
SheetDescription,
SheetFooter,
SheetHeader,
SheetTitle,
SheetTrigger,
} from "@freshgemui/monoplinth";
export function Example() {
return (
<Sheet>
<SheetTrigger asChild>
<Button>Open sheet</Button>
</SheetTrigger>
<SheetContent side="right">
<SheetHeader>
<SheetTitle>Filter tokens</SheetTitle>
<SheetDescription>Narrow results by mode or theme.</SheetDescription>
</SheetHeader>
<SheetFooter>
<SheetClose asChild>
<Button variant="outline">Close</Button>
</SheetClose>
</SheetFooter>
</SheetContent>
</Sheet>
);
}Do and don't
Do: Round only the two inner corners
Edge-anchored panels flush against the viewport keep outer corners square and apply radius-xl (24px) to the inner edge.
Don't: Use Sheet for short two-button confirmations
Prefer Dialog for brief confirmations; reserve Sheet for navigation, filters, or multi-field drawers.
Accessibility
- Shares full Radix Dialog modal semantics:
aria-modal="true",aria-labelledby,aria-describedby, focus trap, body scroll lock, and focus return on close. Escape, scrim clicks, and thearia-label="Close"button dismiss the sheet.- Nested
Select,Popover, andTooltipcomponents portal insideSheetContentso they render above the panel without clipping.
Rationale
Matching Dialog part names (SheetHeader, SheetTitle, SheetDescription, SheetFooter) lets teams switch between centered modals and edge drawers without rewriting markup structure.