Drawer

A drag-to-dismiss overlay panel with velocity and distance thresholds. Slides in from any edge of the screen.

Default

Bottom drawer with a visible grab handle.

With Form

Drawer containing a login form.

Usage

julia
using Suite

Drawer(
    DrawerTrigger(
        Button(variant="outline", "Open Drawer")
    ),
    DrawerContent(
        DrawerHandle(),
        DrawerHeader(
            DrawerTitle("Title"),
            DrawerDescription("Description text."),
        ),
        Div(:class => "p-4", P("Drawer body content.")),
        DrawerFooter(
            Button("Confirm"),
            DrawerClose(
                Button(variant="outline", "Cancel")
            ),
        ),
    ),
)

Keyboard Interactions

KeyAction
EscapeClose the drawer

API Reference

Drawer

PropTypeDefaultDescription
children...Any-Drawer trigger and content
classString""Additional CSS classes

DrawerTrigger

PropTypeDefaultDescription
children...Any-Element that opens the drawer on click
classString""Additional CSS classes

DrawerContent

PropTypeDefaultDescription
children...Any-Content rendered inside the drawer panel
directionString"bottom"Slide direction: "bottom", "top", "left", or "right"
classString""Additional CSS classes

DrawerHeader

PropTypeDefaultDescription
children...Any-Header content (title and description)
classString""Additional CSS classes

DrawerFooter

PropTypeDefaultDescription
children...Any-Footer content (action buttons)
classString""Additional CSS classes

DrawerTitle

PropTypeDefaultDescription
children...Any-Title text
classString""Additional CSS classes

DrawerDescription

PropTypeDefaultDescription
children...Any-Description text
classString""Additional CSS classes

DrawerClose

PropTypeDefaultDescription
children...Any-Element that closes the drawer on click
classString""Additional CSS classes

DrawerHandle

PropTypeDefaultDescription
classString""Additional CSS classes for the visual grab indicator