Skip to content

Drawer

SDrawer is a panel that slides in from the side (or from the top or bottom). It is built on the modal Reka UI Dialog primitive (focus trap, Esc, overlay, portal) and attached to an edge with the side prop. It is controlled with v-model:open; the title and description come from props or slots, the body from the default slot, and the buttons from the #footer slot.

Sides

Title and close slots

The title, description, and close slots replace the default header markup, for example an icon next to the title and a custom close button with SIcon.

The panel is rendered in a portal at body, so the class, style, and attributes passed to SDrawer land directly on .s-drawer__content.

API

Props

NameTypeDefaultDescription
squarebooleanundefinedSquare corners: removes the rounding (rounded by default).
side | "right" | "left" | "top" | "bottom""right"Side the drawer is attached to.
titlestringundefinedDrawer title (can be replaced with the title slot).
descriptionstringundefinedDescription below the title (can be replaced with the description slot).
close-labelstringundefinedAccessible name of the close button (taken from the locale dictionary by default).
openbooleanundefinedWhether the drawer is open. Two-way binding via v-model:open.

Events

NameSignatureDescription
update:open(value: boolean | undefined) => voidEmitted when open changes. Used for two-way binding (v-model:open).

Slots

NameDescription
triggerTrigger element that opens the drawer (wrapped in DialogTrigger).
titleTitle (replaces the title prop).
descriptionDescription (replaces the description prop).
defaultMain content (body) of the drawer.
footerFooter, usually action buttons.
closeClose button content (× by default).