overlay — wyrd.component.drawer

Drawer

Side-anchored dialog surface with canonical open state, dismissal policy, focus management, and reduced-motion behavior.

Install @wyrd-company/react or the Flutter package and use it directly — your DESIGN.md does the styling.

01

Examples

Generated from the contract's examples block. Previews are the published @wyrd-company/react component, themed by the brand's role tokens — flip the site's light/dark toggle and they follow.

Code target Applies to every example on component pages.
end state: open

Navigation

Primary links and account tools.
Usage
import { WyrdDrawer } from "@wyrd-company/react";

<WyrdDrawer defaultOpen side="end" title="Navigation">
  Primary links and account tools.
</WyrdDrawer>

// events: onOpenChange, onDismiss
start state: open
Filter controls for the current result set.
Usage
import { WyrdDrawer } from "@wyrd-company/react";

<WyrdDrawer defaultOpen side="start" label="Filters">
  Filter controls for the current result set.
</WyrdDrawer>

// events: onOpenChange, onDismiss
bottom state: open

Details

Secondary details anchored to the bottom edge.
Usage
import { WyrdDrawer } from "@wyrd-company/react";

<WyrdDrawer defaultOpen side="bottom" title="Details" actions="Close">
  Secondary details anchored to the bottom edge.
</WyrdDrawer>

// events: onOpenChange, onDismiss
02

Properties

NameTypeDefaultSummary
is-open boolean false Controlled open state.
default-open boolean false Initial uncontrolled open state.
is-modal boolean true Makes background content inert while the drawer is open.
dismissible boolean true Allows Escape, backdrop, and platform back navigation to request dismissal.
side start | end | bottom end Anchored edge; start and end are logical, RTL-aware sides.
label string undefined Accessible-name fallback used when the title slot is absent.
03

Slots & events

SlotCardinalityAcceptsSummary
title zero-or-one text, node Optional drawer title and preferred accessible-name source.
content one-or-many content, node Drawer content.
actions zero-or-many action, component Drawer action area.
EventPayloadSummary
open-change is-open, reason Canonical open-state change event.
dismiss reason Dismissal request emitted before a dismissible drawer closes.
04

Tokens

The contract's token bindings. Open the shared contextual sidebar from any example; primary swatches reflect the color you pick there. Error swatches show the active preset's values; editing any knob switches to custom and resets error to TWW · Ink.

BindingToken
panel.background color.surface-container
panel.foreground color.on-surface
panel.border-color color.outline
scrim.color color.on-background
scrim.opacity opacity.muted
border-width 1px
radius rounded.lg
shadow shadow.lg
padding-x spacing.lg
padding-y spacing.lg
gap spacing.md
inline-size 24rem
block-size 20rem
05

States

StateSourceSummary
closed behavior-runtime Drawer is absent from the active overlay surface.
opening behavior-runtime Drawer is entering and focus is moving into the surface.
open behavior-runtime Drawer is visible and owns modal focus semantics.
dismissing behavior-runtime Drawer is exiting and focus is restoring.
06

Accessibility

From the contract's accessibility obligations. Role dialog; Title slot provides the accessible name when present; otherwise label property provides the accessible name.

  • Escape requests dismissal when dismissible is true.
  • Tab and Shift+Tab cycle inside a modal drawer.
  • Modal drawer makes background content inert on web targets.
  • Focus moves into the drawer on open and restores to trigger or return target on close.
  • Each drawer instance must provide either a title slot or label property.
  • Verified under: rtl, reduced-motion, cvd-deuteranopia, text-expansion, safe-area.
07

SDUI

Status: partial. Open-state data is serializable; overlay host coordination, focus trap, inert background, accessible-name enforcement, and platform back behavior require host effects.

SerializableMembers
Propertiesis-open, default-open, is-modal, dismissible, side, label
Slotstitle, content, actions
Eventsopen-change, dismiss
The Wyrding Way — a contract-first design system. © Wyrd Company