Skip to content

Dropdown Menu Item

@astryxdesign/core v0.7.1 · DropdownMenuItem

NameTypeDefaultDescription
labelstring | number—Primary text of the row. Use the label slot for rich content.
descriptionstring | number—Secondary line below the label. Use the description slot for rich content.
iconstring | Component—Icon before the label: a CSS icon class (an UnoCSS class such as i-carbon-copy, or one of your own), or a component that draws the SVG. astryx-vue ships no icons. Use the icon slot for arbitrary content.
isDisabledbooleanfalseDisables the row. A disabled row is skipped by the arrow keys and by typeahead, and it does not respond to clicks.
variant'default' | 'destructive''default'Visual variant. destructive recolors the label, description, and icon in the error color for dangerous actions such as Delete. The hover highlight stays the shared neutral, so it still matches every other row.
hasCloseOnSelectbooleantrueWhether activating the row closes the menu. Set it to false for an action that reports its result on the row itself, such as a copy row.
hrefstring—Address the row navigates to. The row then renders as one anchor carrying role="menuitem", so a ⌘/Ctrl-click and a middle click keep the browser's meaning.
target'_blank' | '_self'—Link target. Only used with href.
relstring—Link relationship. Only used with href. noopener and noreferrer are added for target="_blank".
onClick(event: MouseEvent) => void—Called when the row is activated. On a link row it runs before the browser navigates, and it is skipped for a modified click, which the browser owns.

Events ​

NamePayloadDescription
clickMouseEventFired when the row is activated, with the click that activated it. @click and onClick reach the same handler, so a row never runs one twice.

Slots ​

  • icon: arbitrary leading content, replacing the icon prop.
  • label: rich content replacing the label prop.
  • description: rich content replacing the description prop.
  • endContent: trailing content, such as a Kbd shortcut hint.

Native attributes ​

The row root is the element carrying role="menuitem": an <a> when href is set, otherwise the Item root. Attributes and DOM event handlers fall through to it, so id, data-*, aria-*, and drag-and-drop handlers all land on the row. class and style also reach that root, which is how a preview marks one row as highlighted.

The row takes its height from the menu's size, so it matches the trigger button without extra props.