Skip to content

Dropdown Menu ​

A menu of actions triggered by a button. Anchored on pointer / wide screens; a bottom sheet with touch-sized rows on compact touch screens — automatically.

Usage ​

Approximate web preview — the HarmonyOS rendering is the reference.

Checkbox & radio items ​

Approximate web preview — the HarmonyOS rendering is the reference.

API ​

Extracted from the @Param / @Event / @BuilderParam declarations in the library sources.

SDropdownMenu ​

shadcn-vue DropdownMenu. Anchored menu on pointer / wide screens; on compact touch screens it automatically becomes a bottom sheet with touch-sized rows (adaptive: 'auto'). Long menus scroll within the space available next to the trigger.

Items report activation through onSelect (a .onClick() chained on an item does not fire: the row's own click — which also serves keyboard and screen readers — takes it).

PropTypeDefaultDescription
open!!boolean | undefinedundefined
defaultOpenbooleanfalse
EventTypeDefaultDescription
onOpenChange(open: boolean) => void() => { }

Slots: children (trailing closure)

SDropdownMenuTrigger ​

Slots: children (trailing closure)

SDropdownMenuContent ​

bg-popover min-w-[8rem] rounded-md border p-1 shadow-md, or a bottom sheet on compact touch screens.

PropTypeDefaultDescription
sideSparkSide
SparkSide = 'top' | 'right' | 'bottom' | 'left'
'bottom'
alignmentSparkAlign
SparkAlign = 'start' | 'center' | 'end'
'start'
sideOffsetnumber4
adaptiveSparkAdaptive
SparkAdaptive = 'auto' | 'pointer' | 'touch'
'auto'
panelWidthnumber224panel width in vp (shadcn examples use w-56 = 224); children size against it
tokensSparkSurfaceTokens{}Per-instance surface token overrides (instance → theme tokens → recipe), see {@link SparkSurfaceTokens}.

Slots: children (trailing closure)

SDropdownMenuItem ​

Action row; closes the menu after activation (unless keepOpen).

PropTypeDefaultDescription
textResourceStr''
iconstring | undefinedundefined
shortcutstring | undefinedundefined
variantMenuItemVariant
MenuItemVariant = 'default' | 'destructive'
'default'
disabledbooleanfalse
insetbooleanfalse
keepOpenbooleanfalsekeep the menu open after activation
EventTypeDefaultDescription
onSelect() => void() => { }reka-style select event: tap, click, Space / Enter and screen-reader activation

SDropdownMenuCheckboxItem ​

Item with a check mark; toggles checked. Uncontrolled (defaultChecked) values are remembered across openings, keyed by value (default: the label).

PropTypeDefaultDescription
valuestring''identity for the uncontrolled memory (default: the label)
textResourceStr''
shortcutstring | undefinedundefined
checked!!boolean | undefinedundefined
defaultCheckedbooleanfalse
disabledbooleanfalse
EventTypeDefaultDescription
onCheckedChange(v: boolean) => void() => { }

SDropdownMenuRadioGroup ​

Single-choice group. Uncontrolled (defaultValue) values are remembered across openings, keyed by name (default: the defaultValue — give groups sharing a defaultValue distinct names).

PropTypeDefaultDescription
namestring''identity for the uncontrolled memory (default: the defaultValue)
value!!string | undefinedundefined
defaultValuestring''
EventTypeDefaultDescription
onValueChange(v: string) => void() => { }

Slots: children (trailing closure)

SDropdownMenuRadioItem ​

PropTypeDefaultDescription
valuestring''
textResourceStr''
disabledbooleanfalse

SDropdownMenuLabel ​

PropTypeDefaultDescription
textResourceStr''
insetbooleanfalse

SDropdownMenuSeparator ​

No props.

SDropdownMenuGroup ​

Slots: children (trailing closure)

MIT Licensed