Skip to content

Quaternary Menu Button

<tpg-quaternary-menu-button></tpg-quaternary-menu-button>

The Quaternary Menu Button is essentially a menu with a quaternary toggle button as its anchor.

Quaternary Menu Buttons can elicit a list of drop-down choices from the user, the list can contain:

  • Action Item - allows to execute a push action, after that the menu will close. Push actions can be structured in multiple submenu levels.
  • Submenu Item - allows to open a new submenu level of Menu Items. Only one Submenu Item can be open at the same time in each level.

The Quaternary Menu Button works very much like Menu. Read more about Menu here.

The key difference is that the Quaternary Menu Button comes pre-anchored to a Quaternary Button Toggle, making it easier to implement out of the box — no additional setup is needed to attach the menu to its trigger.

Examples

Setting the label

Use the label attribute to set the label of the Quaternary Menu Button.

Disabling the button

You can disable the Quaternary Menu Button with the disabled attribute.

Size

You can control the Quaternary Menu Button’s size using the size attribute

Activated indicator

Use the activated attribute to show the activated indicator on the Quaternary Menu Button

Opening the menu

The Quaternary Menu Button is closed by default, opening upon being clicked (with the exception of when disabled). You can control this behavior by using the is-open attribute.

Icons

To set an icon, use the icon-template attribute in combination with your desired icon.

You can also control its position using the icon-position attribute, which allows for leading | trailing | top. The icon will by default be in a leading position.

Nesting menus

You can nest menus by inserting a tpg-menu and slotting tpg-menu-items into it.

There is no limit to how many menus you can nest, but it is generally recommended not to go deeper than one level.

Handling events

The Quaternary Menu Button dispatches a TpgSelectEvent when a Menu Item is clicked. See examples below for how you can handle this event.

Tables

Properties

Attribute Property Description Type Default Value
label label Textual label of the button. Overridden from Menu. string ''
disabled disabled Flag that disables the button, just like vanilla boolean false
icon-template iconTemplate URI-encoded SVG template for the button's icon. Supported constants are found in IconConstant | '' ''
icon-position iconPosition The positioning of the icon 'leading' | 'trailing' | 'top' 'leading'
size size The type property if defined will overide size. This is because quaternary button toggle differs from other buttons, and need special treatment 'x-small' | 'small' | 'regular' 'regular'
activated activated The activated state is used to display an activated_indicator at the bottom of the button. boolean false
is-open isOpen Determines if the menu is open. boolean false

Events

Event name Reactjs attribute Description
tpg-select ontpg-select Propagated event that fires from `tpg-menu-item`, containing the value identifier of the selected item.

Functions

Name Description Arguments
No functions found.

Slots

Name Description
Default slot allowing menus and menu items to be inserted.
counter-badge sets the counter-badge of the underlying quaternary button

CSS Parts

Attribute Description
No CSS parts found.

Sandbox