Weftv0.4.0
GitHubFigma
Blade AI
Display · Action List Itemstable

Action List Item

One row in a vertical list of actions: the inside of dropdown menus, context menus and selection panels. Default, destructive and checkbox types, with an optional icon and shortcut hint; ActionListLabel and ActionListSeparator group items.

Preview

#preview

Change the options and the code follows. Show code opens the React snippet.

action-list-item-example.tsx
import { ActionList, ActionListItem } from "@blade-ai/weft/components/action-list-item";

export function AccountMenu() {
  return (
    <ActionList accessibilityLabel="Account">
      <ActionListItem icon={PlusIcon} shortcut="⌘P">
        Profile
      </ActionListItem>
    </ActionList>
  );
}

All states

#all-states

Three types by default, focus, hover, pressed and disabled, plus section label and separator, from the Action List Item artboard.

Action List Item · 8 states
type = default
type = destructive
type = checkbox
Hover
Focus
Pressed
Disabled
Section label · separator

Props

#props

Read from the component source. Booleans are is-prefixed. A star marks a required prop.

ActionListItem
Prop
Type
Default
Description
children *
ReactNode
—
Item label.
type
"default" | "destructive" | "checkbox"
"default"
"destructive" paints label and icon negative; "checkbox" shows a trailing check when checked.
icon
IconComponent
—
Leading icon (default and destructive types).
shortcut
string
—
Trailing keyboard shortcut hint, e.g. "⌘P". Display only; bind the shortcut in the app.
isChecked
boolean
false
Checked state for type "checkbox". Exposed as aria-checked.
isDisabled
boolean
false
—
onClick
(event: MouseEvent<HTMLButtonElement>) => void
—
Not fired while isDisabled.
data-state
"hover" | "focus" | "pressed"
—
—
ActionList
Prop
Type
Default
Description
children *
ReactNode
—
—
accessibilityLabel
string
—
Accessible name for the menu.
ActionListLabel
Prop
Type
Default
Description
children *
ReactNode
—
—

Usage

#usage

Short rules for choosing and writing action list item.

Do
Group related items under a section label and separate groups with a separator.
Keep labels short and start with a verb.
Put destructive items last, after a separator.
Don't
List many unrelated items in one flat group.
Use the shortcut hint as a binding; bind the key separately.
Mix checkbox items with plain actions without a separator.

Accessibility

#accessibility

ActionList renders role="menu"; each row is a menu item.

Keyboard
Key
Action
↓ / ↑
Moves focus to the next / previous item.
Enter / Space
Activates the focused item.
Esc
Closes the menu that contains the list (handled by the parent).
ARIA
Element
Role / attribute
When
ActionList
role="menu" · aria-label
Set accessibilityLabel to name the menu.
ActionListItem
role="menuitem"
default and destructive types.
ActionListItem (checkbox)
role="menuitemcheckbox" · aria-checked
type="checkbox"; reflects isChecked.
Disabled item
disabled · aria-disabled
isDisabled; not fired on click.