Components
Menu
Menus display a list of actions or options that a user can choose. They open from a trigger and close on selection.
Anatomy
Anatomy
import {Menu} from '@staffbase/design';
<Menu.Root>
<Menu.Trigger />
<Menu.Popup>
<Menu.Group>
<Menu.GroupLabel />
<Menu.Item />
</Menu.Group>
<Menu.Separator />
<Menu.Item />
</Menu.Popup>
</Menu.Root> API reference
Root
Inherits props fromBase UI Menu Root
Trigger
Inherits props fromBase UI Menu Trigger
| Name | Type | Description |
|---|---|---|
children | ReactNode | Opens the menu when activated. Passed as a single button element, not via a render prop. |
Popup
Inherits props fromBase UI Menu Positioner
| Name | Type | Description |
|---|---|---|
children | ReactNode | The menu items, groups, and separators. |
side | topbottomleftrightinline-startinline-end | Which side of the trigger to position the menu against. Default: bottom |
align | startcenterend | How to align the menu against the trigger. Default: end |
container | HTMLElementRefObject<HTMLElement> | Use this instead of z-index to specify another parent element to render the menu portal into. Default is the document body. |
Item
Inherits props fromBase UI Menu Item
| Name | Type | Description |
|---|---|---|
children | ReactNode | The label of the menu item. |
variant | neutralcritical | The visual style of the item. Use "critical" for destructive actions. Default: neutral |
leadingIcon | ReactNode | An icon rendered before the item label. |
description | string | Secondary text rendered beneath the item label. |
Separator
Inherits props fromBase UI Menu Separator
Group
Inherits props fromBase UI Menu Group
| Name | Type | Description |
|---|---|---|
children | ReactNode | A group label and the items it labels. |
GroupLabel
Inherits props fromBase UI Menu Group Label
| Name | Type | Description |
|---|---|---|
children | ReactNode | The text that labels the group. |
RadioGroup
Inherits props fromBase UI Menu Radio Group
RadioItem
Inherits props fromBase UI Menu Radio Item
| Name | Type | Description |
|---|---|---|
children | ReactNode | The label of the radio item. |
value | any | The value of the radio item, compared against the radio group value. |
SubMenuRoot
Inherits props fromBase UI Menu Submenu Root
SubMenuTrigger
Inherits props fromBase UI Menu Submenu Trigger
| Name | Type | Description |
|---|---|---|
children | ReactNode | The label of the submenu trigger. |
leadingIcon | ReactNode | An icon rendered before the trigger label. |