Left Side
Enters from the left, where navigation belongs.
<Drawer>
<Drawer.Trigger asChild>
<Button variant="soft">Open Left</Button>
</Drawer.Trigger>
<Drawer.Content side="left">
<Drawer.Close />Slides a panel in from a screen edge and dims the page behind it.
import { Drawer } from "@/fragments/ui";Source<Drawer>
<Drawer.Trigger asChild>
<Button>Open Drawer</Button>
</Drawer.Trigger>
<Drawer.Content>
<Drawer.Close />npx @usefragments/cli add drawerWrites src/fragments/ui/components/Drawer plus what it imports, the globals stylesheet, and .fragments/registry-lock.json, then prints the packages to add. No account, no key.
Your own registry: publish from Fragments Cloud and add --registry org/name. Connect a workspace.
Drawer is a compound: import the root and reach its parts through dot notation.
Drawer.TriggerDrawer.ContentDrawer.CloseDrawer.SwipeAreaDrawer.HeaderDrawer.TitleDrawer.DescriptionDrawer.BodyDrawer.FooterEnters from the right, the default for editing and forms.
<Drawer>
<Drawer.Trigger asChild>
<Button>Open Drawer</Button>
</Drawer.Trigger>
<Drawer.Content>
<Drawer.Close />
<Drawer.Header>
<Drawer.Title>Drawer Title</Drawer.Title>
<Drawer.Description>
A panel sliding in from the right.
</Drawer.Description>
</Drawer.Header>
<Drawer.Body>
<p>Drawer content goes here.</p>
</Drawer.Body>
<Drawer.Footer>
<Drawer.Close asChild>
<Button variant="soft">Cancel</Button>Enters from the left, where navigation belongs.
<Drawer>
<Drawer.Trigger asChild>
<Button variant="soft">Open Left</Button>
</Drawer.Trigger>
<Drawer.Content side="left">
<Drawer.Close />Rises from the bottom for touch-reachable actions.
<Drawer>
<Drawer.Trigger asChild>
<Button variant="soft">Open Bottom Sheet</Button>
</Drawer.Trigger>
<Drawer.Content side="bottom" width="sm">
<Drawer.Header>Fields in the body, submit and cancel pinned to the footer.
<Drawer>
<Drawer.Trigger asChild>
<Button>Edit Settings</Button>
</Drawer.Trigger>
<Drawer.Content width="md">
<Drawer.Close />Prop | Type | Default | Description |
|---|---|---|---|
childrenRequired | node | Not set | Drawer content (use Drawer.Content, Drawer.Header, etc.) |
open | boolean | Not set | Controlled open state |
defaultOpen | boolean | false | Default open state (uncontrolled) |
onOpenChange | function | Not set | Called when open state changes |
modal | union | true | Whether to render as modal (blocks interaction with rest of page) |
disablePointerDismissal | boolean | Not set | Disable outside-click dismissal |
onOpenChangeComplete | function | Not set | Called after open/close animation completes |
snapPoints | array | Not set | Preset snap-point heights for bottom-sheet drawers |
swipeDirection | enumupdownleftright | derived from `side` prop on Content | Swipe direction to dismiss. |