Quaff

QDrawer

Drawers place navigation or supporting content beside the page. They can share space with content or overlay it, adapting to smaller screens.

Workspace
folder

Everything in its place

Open the drawer to explore your workspace.

info QDrawer API Source

interface QDrawerProps extends HTMLAttributes<HTMLDivElement>

behavior
?: QDrawerBehaviorOptions = "default"
Controls responsive behavior: "default" follows the breakpoint, "mobile" uses a modal drawer and "desktop" uses a standard drawer.

bordered
?: boolean = false
Whether the component should have a border.

breakpoint
?: number = BREAKPOINTS.md
The viewport width below which the drawer uses modal behavior and swipe gestures. Defaults to the MD3 expanded breakpoint; at 840px the drawer becomes standard.

elevated
?: boolean = undefined
Determines whether the drawer has an elevated effect. (not supported yet)

noSwipe
?: boolean = false
Determines whether swipe gestures opening the drawer should be disabled or not.

overlay
?: boolean = false
Determines whether the drawer should behave like an overlay (opening above the content) or not (pushing the content while opening).

persistent
?: boolean = false
Prevents dismissal by clicking outside, pressing Escape or swiping. Modal focus stays inside the drawer.

showIfAbove
?: boolean = undefined
Determines whether the drawer should be shown if the viewport width is above the specified breakpoint. (not supported yet)

side
?: QDrawerSideOptions = "start"
Position of the drawer. "start" and "end" follow its direction; "left" and "right" stay physical.

swipeThreshold
?: `${number}%` = "30%"
The threshold in percentage of the drawer width that must be swiped for the drawer to snap open/close. This is only applicable if swipe gestures are enabled.

value
?: boolean = $bindable(false)
The bound value of the component.

width
?: number = 360
Width of the drawer in pixels. Standalone drawers also support CSS-unit strings at runtime.

Usage

Basic Usage
Place QDrawer in QLayout's drawerStart snippet and bind value to control it. The drawer shares space with content on wide screens and becomes modal below its breakpoint.

Navigation

My workspace

Home

Use the menu button to open or close navigation.

Expandable Navigation
Group related destinations with QNavGroup. Selecting a page here updates the content and closes the drawer. Use raw to paths for app navigation; see QNavItem and QNavGroup.
Projects

Current page

Website

Drawer Sides
side="start" follows the reading direction; side="end" uses the opposite edge. Match them with QLayout's drawerStart and drawerEnd snippets. Use left or right when an edge must stay physical.
view_sidebar

Navigation on one side, details on the other.

Behavior and Appearance
overlay opens above content with a scrim. persistent prevents outside clicks, Escape, and swipes from dismissing it, so provide a close button. bordered adds an edge border; numeric width uses pixels and defaults to 360. The default responsive breakpoint is 840px; behavior="desktop" or "mobile" forces one presentation. Open the drawer to adjust its width.
Overlay
Persistent
Bordered
Drawer settings

Page content

Compare overlay and standard behavior on a wide screen.

Programmatic Control
Use bind:this to call show(), hide(), or toggle(). Bind value when the rest of the page also needs the open state.

Drawer state: Closed

Working with QLayout
QLayout's view controls how drawers share space with headers and footers. This example lets the start drawer extend beside both bars. See QLayout for view combinations.

Navigation

App layout

Workspace · All changes saved

Page content

Header, drawer, and footer share one layout.

Accessibility
Name each drawer with aria-label or aria-labelledby, and label its toggle button. Modal drawers contain focus and return it when closed; Escape dismisses them unless persistent is set. Always provide a close action, and use real links for destinations in your app.