Showcases and examples
7 documented examples · Context from Dropdown Menu
Usage
A checkable menu item (role="menuitemcheckbox") that toggles an independent boolean. Use for on/off options inside a DropdownMenu; for a one-of-N choice use DropdownMenuRadioGroup.
Typed props
| Prop | Type and behavior |
|---|
label | ReactNodePrimary label text identifying the item. |
|---|
description | ReactNodeSecondary description text displayed below the label. |
|---|
icon | IconTypeIcon to display before the label. See npx astryx docs icons for valid semantic names. |
|---|
value | booleanWhether the item is checked. Controlled; pair with onChange. |
|---|
onChange | (checked: boolean) => voidCallback fired with the next checked state when the item is toggled. |
|---|
isDisabled | boolean · default falseWhether the item is disabled. Disabled items stay focusable (via aria-disabled) so they remain discoverable by keyboard and assistive technology, but activation is blocked. |
|---|
hasCloseOnSelect | boolean · default falseWhether toggling the item closes the menu. Checkbox items default to staying open so several can be toggled in a single session. |
|---|
ref | React.Ref<HTMLElement>Ref forwarded to the row root, the element carrying role="menuitemcheckbox". Register the row with an element-keyed observer or overlay. |
|---|
endContent | ReactNodeContent to render after the label and description, such as a keyboard shortcut hint or badge. |
|---|