Components / Actions
MenuButton
A button that opens a menu (with nested submenus) and returns focus when it closes. Extra attributes such as data-testid go to the trigger button.
@ruckc/truss-ui Actions
Import
import { MenuButton } from '@ruckc/truss-ui'; Playground
variant
intent
size
align
API
Also accepts every attribute of HTMLButtonAttributes, applied to the underlying element.
| Prop | Type | Default | Description |
|---|---|---|---|
label required | string | — | Visible label shown above the control. |
icon | IconSource | — | Name of a built-in icon to show. |
items required | MenuEntry[] | — | The items to render. |
variant | 'filled' | 'tonal' | 'outlined' | 'minimal' | 'outlined' | Visual style of the control. |
intent | 'primary' | 'neutral' | 'success' | 'warning' | 'danger' | 'neutral' | Semantic colour: `primary`, `neutral`, `success`, `warning` or `danger`. |
size | 'sm' | 'md' | 'lg' | 'md' | Control size: `sm` (24px), `md` (32px, default) or `lg` (40px). |
align | 'start' | 'end' | 'start' | Alignment (`start` or `end`). |
iconOnly | boolean | false | Show only the icon (label becomes the accessible name). |