navigation — wyrd.component.menu

Menu

Popup command collection with a trigger label, canonical open state, collection navigation, and one select event.

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.
closed state: closed
Usage
import { WyrdMenu } from "@wyrd-company/react";

<WyrdMenu label="Actions" items={[{"id":"edit","label":"Edit"},{"id":"duplicate","label":"Duplicate"},{"id":"delete","label":"Delete"}]} isOpen={false} />

// events: onOpenChange, onSelect
open state: open
Usage
import { WyrdMenu } from "@wyrd-company/react";

<WyrdMenu label="Actions" items={[{"id":"edit","label":"Edit"},{"id":"duplicate","label":"Duplicate"},{"id":"delete","label":"Delete"}]} defaultOpen />

// events: onOpenChange, onSelect
disabled state: disabled
Usage
import { WyrdMenu } from "@wyrd-company/react";

<WyrdMenu label="Actions" items={[{"id":"edit","label":"Edit"},{"id":"duplicate","label":"Duplicate"},{"id":"delete","label":"Delete"}]} isDisabled />

// events: onOpenChange, onSelect
context-menu state: closed
Usage
import { WyrdMenu } from "@wyrd-company/react";

<WyrdMenu label="File actions" triggerMode="context-menu" items={[{"id":"rename","label":"Rename"},{"id":"duplicate","label":"Duplicate"},{"id":"delete","label":"Delete"}]} />

// events: onOpenChange, onSelect
02

Properties

NameTypeDefaultSummary
label string Menu Trigger label and accessible-name source for the menu button.
items array [object Object],[object Object],[object Object] Ordered menu item data; disabled items render but are skipped by collection navigation and activation.
is-open boolean false Controlled popup visibility.
default-open boolean false Initial uncontrolled popup visibility.
is-disabled boolean false Prevents opening and item activation.
trigger-mode button | context-menu button Opens from the button or from a context-menu gesture on the trigger surface.
03

Slots & events

EventPayloadSummary
open-change is-open, reason Canonical popup visibility event.
select id, label Canonical item activation event emitted once per accepted selection.
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
trigger.background color.surface
trigger.foreground color.on-surface
trigger.border-color color.outline
trigger.padding-x spacing.md
trigger.padding-y spacing.sm
panel.background color.surface-container
panel.foreground color.on-surface
panel.border-color color.outline
item.active-background color.primary-hover
item.active-foreground color.on-primary
item.padding-x spacing.md
item.padding-y spacing.sm
radius rounded.md
border-width 1px
gap spacing.xs
padding-x spacing.xs
padding-y spacing.xs
05

States

StateSourceSummary
closed behavior-runtime Popup content is not visible.
open behavior-runtime Popup content is visible and collection navigation is active.
focus-visible platform Trigger or active item has keyboard-visible focus.
disabled property Disabled state derived from is-disabled.
06

Accessibility

From the contract's accessibility obligations. Role menu; Label property provides the accessible name for the menu button.

  • Enter, Space, ArrowDown, and ArrowUp open the menu from the trigger.
  • ArrowDown and ArrowUp move the active item while the popup is open.
  • Home and End move to the collection boundaries.
  • Typeahead moves to the next matching item.
  • Escape closes the menu and restores focus to the trigger.
  • Tab dismisses the menu and allows normal focus traversal.
  • In context-menu trigger mode, Shift+F10 and the ContextMenu key open the menu at the focused trigger surface.
  • Trigger exposes menu popup and expanded state.
  • Popup exposes menu semantics and active descendant state where supported.
  • Disabled menu prevents popup opening and item activation.
  • Disabled items remain visible but are skipped by keyboard navigation and do not activate.
  • Context-menu trigger mode keeps the trigger surface keyboard focusable and exposes menu popup state.
  • Verified under: rtl, reduced-motion, cvd-deuteranopia, density-compact.
07

SDUI

Status: serializable. Menu item data and open state serialize; target runtimes own focus, positioning, and keyboard host effects.

SerializableMembers
Propertieslabel, items, is-open, default-open, is-disabled, trigger-mode
Slots
Eventsopen-change, select
The Wyrding Way — a contract-first design system. © Wyrd Company