Drawer
Edge-anchored panel on Ark UI's Drawer machine — swipe-to-dismiss, snap points and a drag grabber, with an RTL-aware placement prop.
The Drawer is an edge-anchored panel built on Ark UI's Drawer state machine — so it ships swipe-to-dismiss, snap points and a drag grabber out of the box. The kit layers on an RTL-aware placement prop (Ark has none): docking, sizing and the slide animation are pure CSS keyed on data-placement, so start/end flip automatically under dir="rtl".
import { Drawer } from '@42/ui-react/drawer';
<Drawer open={open} onOpenChange={setOpen} placement="end" title="Filters">
<Text>Slides in from the inline-end edge.</Text>
</Drawer>Placement
placement accepts the logical edges start / end / top / bottom. start and end resolve against text direction.
Code
<Drawer placement="start" … /><Drawer placement="end" … /> // default<Drawer placement="top" … /><Drawer placement="bottom" … />Sizes
Inline placements (start / end) size on width; block placements (top / bottom) size on height. Both read the size token (xs–xl).
Code
<Drawer placement="end" size="sm" … /><Drawer placement="end" size="lg" … />Grabber
Set withGrabber to show a draggable handle — useful for bottom sheets on touch devices, where the whole panel is swipe-dismissable.
Code
<Drawer placement="bottom" withGrabber title="Quick actions" … />Composable parts
Like Modal, the high-level <Drawer> is backed by parts for full control:
<Drawer.Root open={open} onOpenChange={({ open }) => setOpen(open)} swipeDirection="end">
<Drawer.Backdrop />
<Drawer.Positioner data-placement="end">
<Drawer.Content data-placement="end">
<Drawer.Header>
<Drawer.Title>Filters</Drawer.Title>
<Drawer.CloseTrigger />
</Drawer.Header>
<Drawer.Body>…</Drawer.Body>
</Drawer.Content>
</Drawer.Positioner>
</Drawer.Root>API
Prop
Type
All other props (snapPoints, closeThreshold, modal, trapFocus, …) forward to Ark's Drawer.Root.
Accessibility
- Same focus-trap, scroll-lock and focus-restore guarantees as
Modal— Ark's Drawer machine is a dialog under the hood. placementuses logical edges and CSS logical properties, so the panel and its slide animation mirror correctly underdir="rtl".- Swipe-to-dismiss is a progressive enhancement; keyboard and click paths work without it.
Modal
Centered overlay dialog on Ark UI's Dialog machine — focus trap, scroll lock, RTL and animated enter/exit, with a flat props API and composable parts.
Overlays manager
Spawn modals and drawers imperatively from anywhere — content, confirm and typed context overlays — with one centralized, type-safe manager.