Skip to content

DropdownMenu ​

ARIA menu

Commands behind a button — row actions, a ⋯ menu, a user menu. For choosing a value use Select; for navigation, links.

Basic
last: · checked: { "grid": true } · size: s

Not inside <p>

The floating panel is a <div>. HTML closes a <p> when it meets a <div>, so a trigger placed inside a paragraph renders differently on the server and the client. Wrap with <span>/<div> instead.

  • The trigger is your own button; it is told it opens a menu and whether it's open. ↓ / Enter / Space open it and focus the first item (↑ the last).
  • Arrows, Home / End and typeahead move; Enter selects; Esc closes and returns to the trigger; Tab out closes it.
  • Items can be checkboxes (v-model:checked), radio groups (v-model:radios), separators, labels and submenus. Inside a Menubar, ← / → move between menus.

Usage ​

ts
import { BlessDropdownMenu } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
items*BlessMenuItem[]—
placementPlacement"bottom-start"
checkedRecord<string, boolean>—
radiosRecord<string, string>—
contextboolean—context-menu mode: open at pointer on right click
blockboolean—anchor renders as block (wraps an area rather than a button)
openbooleanfalse

Events

NamePayloadDescription
update:open[value: boolean]
select[item: BlessMenuItem]
update:checked[v: Record<string, boolean>]
update:radios[v: Record<string, string>]

Slots

NameScopeDescription
trigger{ open: boolean; }

Released under the MIT License. Character names and artwork belong to their owners.