Option

Updated:

Provides options within dropdowns.

To be used with the following components:

  • q2-select (Link)
  • q2-pill (Link)
  • q2-tag (Link)
  • q2-optgroup (Link)

Properties

The q2-option element has one or more properties that support text localization. Those properties are indicated by the localizable badge in the description.

Learn more about properties.

disabled

Disables the option.

display

The text that is displayed in the field when selected. If not provided, any text inside the element will be used.

Localizable
separator

Renders a line in the item instead of text. Click events from these items will not have details provided. A separator allows for quick visual grouping of items, so interactions should not be bound to these options.

value

Serves as the option's value.

Events

The q2-option element exposes events that can be used to send and receive data from the component based on user interaction.

Learn more about events.

displayChanged

Used by consuming elements to indicate the display value of the option has changed.

Event Detail Type signature

{ value: string; display: string; }

tctClick

Is emitted when the option is clicked.

Event Detail Type signature

{ type: "select" | "remove"; value: string; }

Dependencies

This component uses other components in the Tecton library, including:

  • q2-icon

Dependents

Other components in the Tecton library use this component, including:

  • q2-action-sheet
  • q2-pagination

Release Notes

Initial Release

Supports nested q2-loc element

Accessibility Report

Tecton components are designed and tested to be WCAG compliant when used appropriately, and do not get released without proper validation. Developers should prefer not to set ARIA attributes when using components from the Tecton Design System.

The following CSS variables are available to override the default theme styles of the q2-optioncomponent.

Dependencies

Many Tecton components consume other components to maintain visual and functional consistency. If you are looking for a CSS variable you think should exist but are not seeing it, it may be defined in one of the dependent components below. Either way, if you think it's something we should expose more conveniently, let us know!

  • q2-icon