ki-menu-item
@kimen/elements/ki-menu-item- Source
- Agent reference
Use this element as a child of Menu.
Give each item a value and a visible label. Use type="checkbox" for independent toggles or type="radio" for exclusive choices. Set disabled to keep an unavailable action discoverable by keyboard.
API reference
When to use: a command, independent checkbox action, or exclusive radio action in a menu.
When not to use: standalone controls, navigational links, or form options.
Properties & attributes
| Attribute | Property | Type | Default | Description |
|---|---|---|---|---|
checked | checked | boolean | false | Checked state for checkbox and radio actions. |
disabled | disabled | boolean | false | Disabled actions remain discoverable via menu navigation. |
shortcut | shortcut | string | '' | Display-only keyboard shortcut. Applications own shortcut registration. |
tone | tone | "danger" | "neutral" | 'neutral' | Apply the danger tone to a destructive action. |
type | type | "checkbox" | "item" | "radio" | 'item' | Action role. A checkbox stays open. A radio selects one action within its group. |
value | value | string | '' | Action identifier reported by the parent menu. |
Slots
| Slot | Description |
|---|---|
| (default) | The action's visible label. |
start | One decorative icon or avatar before the label. |
CSS parts
| Part | Description |
|---|---|
check | The indicator of a checked action. |
item | The focusable action row. |
shortcut | The display-only shortcut hint. |
CSS custom properties
The public styling contract of ki-menu-item: reassign these tokens at :root or on a subtree — never override internals.
| Token | Description |
|---|---|
--ki-density-control-offset | Added to the block size of every scaled control and row (button, icon button, field, select, textarea, option, list item, tab). Components floor the result at ki.size.target-min. |
--ki-density-target-min | The smallest pointer target any density may produce: 24 x 24 CSS px by default and in compact (WCAG 2.5.8 AA), 44 x 44 in touch (WCAG 2.5.5). It floors a shrinking control but never lifts what a control paints: a control painted smaller extends its target to it, invisibly; rows and tabs grow to it (spec 045 A1). |
--ki-menu-focus-color | Color of a visible keyboard focus outline. |
--ki-menu-focus-width | Width of a visible keyboard focus outline. |
--ki-menu-font-family | Family for action labels and the filter. |
--ki-menu-gap | Inline space between the parts of a row. |
--ki-menu-inline-padding | Start and end inset of an action, group label, or filter. |
--ki-menu-item-danger-fg | Foreground for destructive actions. |
--ki-menu-item-danger-hover-fg | Foreground for hovered or keyboard-focused destructive actions. |
--ki-menu-item-disabled-fg | Muted ink of disabled actions. |
--ki-menu-item-fg | Foreground for resting actions. |
--ki-menu-item-height | Default action row minimum height. |
--ki-menu-item-hover-bg | Background behind hovered or keyboard-focused actions. |
--ki-menu-item-hover-fg | Foreground for hovered or keyboard-focused actions. |
--ki-menu-item-icon-size | Size of an action glyph and the check indicator. |
--ki-menu-item-padding | Vertical inset used when an action wraps. |
--ki-menu-item-radius | Action row corner radius. |
--ki-menu-meta-fg | Foreground for shortcut hints and the filter placeholder. |
--ki-menu-meta-font-size | Size of metadata and group labels. |
--ki-menu-meta-hover-fg | Foreground for shortcut hints on a hovered or focused action. |
--ki-menu-touch-target | Minimum action and filter height for coarse pointers. |