DrawerContent
Loading example…
Side panel (right) or bottom sheet for secondary flows.
Import
Section titled “Import”import { DrawerContent } from "@jcsoftdev/ui/overlays";Single-component entry points tree-shake to just this component: @jcsoftdev/ui/overlays/drawer.
export const Default: Story = { render: (args) => ( <Drawer> <DrawerTrigger asChild> <Button variant="secondary">Ver cita</Button> </DrawerTrigger> <DrawerContent {...args}> <AppointmentDetail /> </DrawerContent> </Drawer> ),};Source of the Storybook story.
| Prop | Type | Default | Description |
|---|---|---|---|
classNames |
Partial<Record<DrawerContentPart, string>> |
Per-part classes merged with cn; consumer classes win. className still targets the content and is merged last. |
|
material |
"solid" | "glass" | "glass-clear" | "liquid" | "liquid-clear" |
Surface material. Omitted keeps the default for this layer; "glass" and "glass-clear" are frosted glass, "liquid" and "liquid-clear" Liquid Glass (with its fallbacks), "solid" forces an opaque surface. Liquid options go in style (liquidStyle() f… |
|
blocking |
boolean |
false |
Same semantics as DialogContentProps.blocking. |
closeLabel |
string |
Accessible label of the close button. | |
side |
"bottom" | "right" |
"right" |
Edge the panel is anchored to. "right" (default) is a side panel up to 430 px wide; "bottom" is a bottom sheet across the width, padded by the safe-area inset and capped at 85dvh with its own scroll. Focus is trapped and Escape closes it on both. |
handle |
boolean |
false |
Shows a grab handle at the top of a side="bottom" sheet. It is decorative (hidden from assistive tech); dragging it down closes the sheet unless blocking. Ignored on other sides. |
forceMount |
boolean |
||
onOpenAutoFocus |
((event: Event) => void) |
||
onCloseAutoFocus |
((event: Event) => void) |
||
onEscapeKeyDown |
((event: KeyboardEvent) => void) |
||
onPointerDownOutside |
((event: PointerDownOutsideEvent) => void) |
||
onFocusOutside |
((event: FocusOutsideEvent) => void) |
||
onInteractOutside |
((event: InteractOutsideEvent) => void) |
||
intent |
string |
||
intentKey |
string |
* marks a required prop.
It also accepts the native props of the element or primitive it renders (for example className, id, aria-* and event handlers).
Storybook stories
Section titled “Storybook stories”Source
Section titled “Source”packages/ui/src/overlays/drawer/drawer.tsx