Vivid API

Option

Use to display an option list inside the Select, Searchable Select or Combobox components

Usage

import { registerOption } from '@vonage/vivid-api';
registerOption('your-prefix');

Label

The label attribute can be used to display different text in the parent element when selected.

In the example below, the international dialing code (label) is displayed when selected, but the country name (text) is used in the option list.

Slots

Icon Slot

Set the icon slot to show an icon before the option’s text. If set, the icon attribute is ignored.

Trailing Meta Slot

Use the trailing-meta slot to add an element (like a badge or an additional icon) to the end of Option.

Tag Icon Slot

If the option is represented as a tag in a Searchable Select component, you can use tag-icon slot to show an icon in the tag.

API Reference

Properties

PropertyTypeDefaultDescription
checkedfalse | trueThe checked state is used when the parent listbox is in multiple selection mode. To avoid accessibility conflicts, the checked state should not be present in single selection mode.
connotation'accent' | 'cta'Sets the connotation that appears when selected
defaultSelectedbooleanSets the option's initial selected state (mirrors the native `selected` attribute)
disabledbooleanThe disabled state of the option.
iconTrailingbooleanIndicates the icon affix alignment.
_labelstring
matchedTextstringText to highlighted as matching a search query
selectedbooleanIndicates whether the option is currently selected
selectedAttributeboolean
tagConnotation'accent' | 'cta'When displayed as a tag, the connotation of the tag
_textstring
textSecondarystringSecondary text displayed below or next to the primary text
valuestringThe value of the option.
PropertyTypeDefaultDescription
checkedfalse | trueThe checked state is used when the parent listbox is in multiple selection mode. To avoid accessibility conflicts, the checked state should not be present in single selection mode.
connotation'accent' | 'cta'Sets the connotation that appears when selected
selectedbooleanSets the option's initial selected state (mirrors the native `selected` attribute)
disabledbooleanThe disabled state of the option.
icon-trailingbooleanIndicates the icon affix alignment.
labelstring
matched-textstringText to highlighted as matching a search query
current-selectedbooleanIndicates whether the option is currently selected
selectedAttribute
(property only)
boolean
tag-connotation'accent' | 'cta'When displayed as a tag, the connotation of the tag
textstring
text-secondarystringSecondary text displayed below or next to the primary text
valuestringThe value of the option.

Slots

NameDescription
iconThe preferred way to add an icon to the component.
tag-iconIcon to be displayed in the tag when selected inside of Searchable Select.
trailing-metaFor additional elements at the end of the Option.
NameDescription
iconThe preferred way to add an icon to the component.
tag-iconIcon to be displayed in the tag when selected inside of Searchable Select.
trailing-metaFor additional elements at the end of the Option.