Menu presents a set of actions to perform on the currently visible or selected resource.
There are use cases when a "More" or "Actions" menu is needed to show contextual actions relevant to the currently visible resource. Usually these menus don't actually say "More" or "Actions", but show an icon with three dots in it.
Hightouch UI offers a convenience component specifically for that use case called MenuActionsButton to replace MenuButton with.
If you need to use a custom icon, use MenuIconButton component.
Use this variant to achieve a border around the menu button.
Use this variant for badge menus.
The menu button (including actions and icon button) can be disabled.
You can also disable individual menu items, instead of disabling the entire button.
The menu opens and closes automatically when the toggle button is clicked. However, the state may be controlled with the isOpen state.
The menu position may be specified using the placement prop. The default is usually the correct option, but in the Journeys canvas the menu may have a centered state.
The menu renders the popover invisibly on mount. To prevent widening the window unintentionally, the menu computes its position on mount. This may be turned off by using computePositionOnMount.
To automatically focus a menu item on menu open, use the autofocus prop.
| Name | Default | Description |
|---|
| Name | Default | Description |
|---|---|---|
variant | "secondary" | "primary" | "secondary" | "tertiary"The button variant. |
size | "md" | "sm" | "md" | "lg"Determines the height of the button. |
| Name | Default | Description |
|---|---|---|
aria-label | "Actions" | stringButton text for screen readers. |
| Name | Default | Description |
|---|---|---|
variant | "tertiary" | "secondary" | "tertiary"Button variant, which determines its appearance. |
onClick | — | (event: MouseEvent<HTMLButtonElement>) => voidClick event handler. |
| Name | Default | Description |
|---|
| Name | Default | Description |
|---|
| Name | Default | Description |
|---|