Vivid API

Menu Item

An option to appear inside a Menu.

Text

The text attribute sets the text content.

Secondary Text

The Menu Item can be given extra context using the text-secondary attribute.

To improve readability, avoid long text and multiple lines where possible.

Icon

The icon attribute sets an icon.

View list of available icon at the vivid icons gallery.

Control Type

The control-type attribute allows the Menu Item to become checkable and behave either as a checkbox or radio button.

When control-type is radio, only one Menu Item can be checked in the current section. Sections are separated by Dividers.

Previously, the role attribute was used to set the control type. This is now deprecated (as of 05/25) and replaced with the control-type attribute. Using role is still functional, but will be removed in a future major release.

Check Trailing

When control-type is set, the check-trailing attribute places the checkbox / radio indicator at the end of the Menu Item.

If the icon attribute is present, the indicator will be trailing by default.

Check Appearance

When control-type is set, the check-appearance attribute changes the appearance of the checkbox / radio indicator.

In the example below it is set to tick-only (default is normal).

Checked

When control-type is set, the checked attribute sets the checked state.

Connotation

The connotation attribute controls the checked color.

Disabled

The disabled attribute controls the disabled state.