Skip to content

Action menu - Web Component

The ActionMenu component can be used imported from:

Playground

Parameters

The Web component uses the <z-action-menu> tag:

By default, all the parameters are optional or can be set in different, except for the ones marked as required

The parametrization of the component can be done with the following custom HTML params:

NameTypeDescriptionSlotA11y
configstring
contentstringText of the dropdowndefault
elementsObject[]Array of dropdown elements

INFO

Check the z-action-menu anatomy to know the specifications for this component. Use the Playground to see how you can customize this component.

Events

This component has events. Check the documentation about how to use the events.

NamePayloadDescription

Slots

This component has slots. Check the documentation about how to use the slots.

NameTagsDescription
defaultspanContent of the action menu
elementsspanAction menu elements
searchspanContent on top of the menu

Parameters use

elements

The elements attribute is used to set the elements of the dropdown menu.

Example

The elements object also allows nested elements.

Example

The elements object also allows sections and separators.

Example

Finally the elements object also allows icons.

Example

Alternatively, you can use the elements slot to set the elements of the dropdown menu. We use specific components per type of element:

  • <a> for link and sub-menu (in case of more elements). For defining a sub-navigation use the attribute data-text for the link text and place the children of the menu inside:
  • <span> for section header

Browser support

Detected engine:  

  • Chromium

  • Webkit

  • Gecko

HTML Examples

CodeSandbox example