Changelog Azalea Kit UI 101 Usage Customizing Utilities Form controls Laravel Vue FHIR Types Accessibility Icons Actions Button Button group Layout and structure Card Card section Care summary Care timeline Divider Empty state Footer Header Layout Stack Table Selection and input Calendar Checkbox Checkbox group Color picker Combobox Combobox option Input Input mask Memorable date Number input Option Phone input Radio Radio button Radio group Range Select SSN input Tag Textarea Toggle ZIP code input Images and icons Avatar Icon Icon button Logo Feedback indicators Badge Banner Progress bar Skeleton Skeleton body text Skeleton display text Skeleton thumbnail Spinner Typography Text Navigation Breadcrumb Breadcrumb item Dropdown Menu Menu item Menu label Navigation Nav group Nav item Nav toggle Pagination Tab Tab group Tab panel Top bar Tree Tree item User menu Overlays Dialog Popover Tooltip Utilities Collapsible FHIR address FHIR human name FHIR quantity FHIR questionnaire Format bytes Format date Format number Relative time Resize observer Split panel Tooltip Border Color Shadow Spacing Transition Typography Z-index Contributing Visual Tests Light Dark System

Combobox Option

<ahi-combobox-option> | AhiComboboxOption

Options define the selectable items within a combobox.

Options define the selectable items within a <ahi-combobox>.

Option 1 Option 2 Option 3
<ahi-combobox label="Select one" placeholder="Type to search...">
  <ahi-combobox-option value="option-1">Option 1</ahi-combobox-option>
  <ahi-combobox-option value="option-2">Option 2</ahi-combobox-option>
  <ahi-combobox-option value="option-3">Option 3</ahi-combobox-option>
</ahi-combobox>

Examples

Disabled

Use the disabled attribute to disable an option. Disabled options will be displayed but cannot be selected.

Option 1 Option 2 (disabled) Option 3
<ahi-combobox label="Select one" placeholder="Type to search...">
  <ahi-combobox-option value="option-1">Option 1</ahi-combobox-option>
  <ahi-combobox-option value="option-2" disabled>Option 2 (disabled)</ahi-combobox-option>
  <ahi-combobox-option value="option-3">Option 3</ahi-combobox-option>
</ahi-combobox>

Prefix & suffix

Add icons or other content to the start and end of combobox options using the prefix and suffix slots.

Email Phone Chat New
<ahi-combobox label="Select one" placeholder="Type to search...">
  <ahi-combobox-option value="email">
    <ahi-icon name="mail" slot="prefix"></ahi-icon>
    Email
  </ahi-combobox-option>
  <ahi-combobox-option value="phone">
    <ahi-icon name="phone" slot="prefix"></ahi-icon>
    Phone
  </ahi-combobox-option>
  <ahi-combobox-option value="chat">
    <ahi-icon name="message-circle" slot="prefix"></ahi-icon>
    Chat
    <ahi-badge slot="suffix" variant="brand" size="small">New</ahi-badge>
  </ahi-combobox-option>
</ahi-combobox>

Usage notes

  • The value attribute is required and must be unique within the combobox
  • Values may contain any characters, including spaces. Only the combobox’s value attribute is space-delimited (HTML attributes can’t express arrays), so an option whose value contains a space can’t be preselected from markup — assign an array to the combobox’s value property instead
  • The option’s label is the text content within the element
  • Options automatically show a checkmark icon when selected
  • Options support keyboard navigation and hover states

Importing

Script Bundler

To import this component using a script tag:

<script type="module" src="/path/to/azalea-kit-ui/dist/components/combobox-option/combobox-option.js"></script>

To import this component using a bundler:

import '@azaleahealth/azalea-kit-ui/dist/components/combobox-option/combobox-option.js';

Slots

Name Description
(default) The option’s label.
prefix Used to prepend an icon or similar element to the option.
suffix Used to append an icon or similar element to the option.

Learn more about using slots.

Properties

Name Description Type Default
value The option’s value. When selected, the containing form control will receive this value. The value must be unique from other options in the same control. Values may contain any characters, including spaces — but a value with spaces can’t be targeted by the control’s space-delimited value attribute (assign an array to the value property instead). string ''
disabled Draws the option in a disabled state, preventing selection. boolean false
updateComplete A read-only promise that resolves when the component has finished updating.

Learn more about properties and attributes.

Methods

Name Description Arguments
getTextLabel() Returns a plain text label based on the option’s content. -

Learn more about methods.

CSS Parts

Name Description
base Deprecated. Use the combobox-option part instead.
combobox-option The component’s outer wrapper.
checked-icon The checked icon, an <ahi-icon> element.
label The option’s label.
prefix The container that wraps the prefix.
suffix The container that wraps the suffix.

Learn more about customizing CSS parts.

Dependencies

This component automatically imports the following dependencies.

  • <ahi-icon>