Skip to content

Dropdown Menu

SDropdownMenu is a dropdown action menu attached to a trigger. It is built on Reka UI (portal, keyboard navigation, roving focus, menu/menuitem roles). The entries come from the items prop: items, separators (separator), and group labels (label); leading icons are rendered with the reusable SIcon.

Basic usage

Item icons

The item's icon field renders a leading icon with SIcon (a registry name or a raw path).

Positioning

The side (where the menu appears) and align (alignment along that side) props control the menu position relative to the trigger.

External control

The open state is bound with v-model:open, so it can be controlled from an external button.

API

Props

NameTypeDefaultDescription
squarebooleanundefinedSquare corners: removes the menu rounding (rounded by default).
items{ type?: | "label" | "item" | "separator"; label?: string; value?: string; icon?: string; disabled?: boolean; danger?: boolean }[]undefinedMenu entries (alternative to the default slot).
side | "right" | "left" | "top" | "bottom""bottom"Side of the trigger the menu appears on.
align"start" | "center" | "end""start"Alignment along the chosen side.
side-offsetnumber8Offset from the trigger in pixels.
modalbooleanfalseModal mode: blocks interaction with the background and enables a focus trap. false by default, so page scroll is not locked (otherwise the scrollbar disappears on open and the layout shifts).
aria-labelstringundefinedAccessible name of the menu (aria-label).
flatbooleanundefinedRemoves the shadow. Overridden by the elevation prop when it is set.
elevation0 | 1 | 2 | 3 | 4 | 5undefinedShadow level 0–5 (scale); 0 means no shadow. Overrides flat.
openbooleanfalseWhether the menu is open. Two-way binding via v-model:open.

Events

NameSignatureDescription
update:open(value: boolean) => voidEmitted when open changes. Used for two-way binding (v-model:open).
select(value: string) => voidA menu item was selected; receives the item's value.

Slots

NameDescription
triggerTrigger element that opens the menu on click.
defaultCustom menu content (instead of the items prop).