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

Option

<ahi-option> | AhiOption

Options define the selectable items within various form controls such as select.

Option 1 Option 2 Option 3
<ahi-select label="Select one">
  <ahi-option value="option-1">Option 1</ahi-option>
  <ahi-option value="option-2">Option 2</ahi-option>
  <ahi-option value="option-3">Option 3</ahi-option>
</ahi-select>

Examples

Disabled

Use the disabled attribute to disable an option and prevent it from being selected.

Option 1 Option 2 Option 3
<ahi-select label="Select one">
  <ahi-option value="option-1">Option 1</ahi-option>
  <ahi-option value="option-2" disabled>Option 2</ahi-option>
  <ahi-option value="option-3">Option 3</ahi-option>
</ahi-select>

Prefix and suffix

Add icons to the start and end of menu items using the prefix and suffix slots.

Email Phone Chat
<ahi-select label="Select one">
  <ahi-option value="email">
    <ahi-icon slot="prefix" name="mail"></ahi-icon>
    Email
    <ahi-icon slot="suffix" name="circle-check"></ahi-icon>
  </ahi-option>
  <ahi-option value="phone">
    <ahi-icon slot="prefix" name="phone"></ahi-icon>
    Phone
    <ahi-icon slot="suffix" name="circle-check"></ahi-icon>
  </ahi-option>
  <ahi-option value="chat">
    <ahi-icon slot="prefix" name="message"></ahi-icon>
    Chat
    <ahi-icon slot="suffix" name="circle-check"></ahi-icon>
  </ahi-option>
</ahi-select>

Importing

Script Bundler

To import this component using a script tag:

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

To import this component using a bundler:

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

Slots

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

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 option part instead.
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>