---
component: zui-select-dropdown
package: "@zywave/zui-select"
elements: ["zui-select-dropdown", "zui-option", "zui-option-group"]
title: "Dropdown selects, Dropdown Multi-Select"
relatedElements: ["zui-option", "zui-option-group"]
source: ["https://booster.zywave.dev/design-system/components/dropdown-selects/", "https://booster.zywave.dev/design-system/components/dropdown-multi-selects/"]
---

<!-- Generated by scripts/node/generate-llm-docs.mjs from packages/components/zui-select/dist/llm/zui-select-dropdown.guidelines.md and packages/components/zui-select/dist/custom-elements.json. Do not edit; re-run npm run docs:llm. -->

# `<zui-select-dropdown>`

## Usage guidelines

### Dropdown selects

A form control for selecting one or more options from a predefined list

#### Usage

Dropdown selects present a list of options in a popover panel that opens when the user activates the trigger. Use one when a form field requires a single choice from a fixed set — especially when the list is long enough that displaying all options inline would take too much space. Dropdown selects support live text filtering and grouped options.

##### When to use Dropdown selects

- The user needs to choose exactly one value from a list of three or more options
- The list is long enough that showing all options inline would clutter the layout
- The options benefit from live text filtering to help users find a value in a large set

##### Don't use Dropdown selects when

- There are only two or three options — use `<zui-radio>` so all choices remain visible without interaction
- The choice is a simple on/off or yes/no — use a `<zui-toggle>` instead
- The user needs to select more than one option — use a `<zui-select-dropdown>` instead
- Both the available pool and the selected set must remain visible at the same time — use a `<zui-multipicker>` instead
- The user needs to search through and select from a large, pageable dataset — use a `<zui-picker>` instead

#### Anatomy

The anatomy of a Dropdown Select.

1. **Select field**: The trigger area the user clicks or taps to open the options panel. Displays the current selection or placeholder text when nothing is selected.
2. **Chevron icon**: Indicates that a dropdown panel is available. Rotates 180° when the panel is open and returns to its original position when it closes.
3. **Option list**: The panel that appears below (or above) the trigger, containing the available choices.
4. **Option**: An individual selectable item within the option list.
5. **Scrollbar**: Appears when the option list contains more items than fit in the visible panel height.

#### Types

##### Searchable

###### When to use

- The option list contains 20 or more items where scrolling to find a value is impractical
- Users frequently know the name of the option they want and typing is faster than browsing

###### Guidelines

- Set a clear "no results" message so users know their filter returned nothing (for example, "No categories match your search")
- Live filtering matches option labels only — group labels are not included in the match

##### Grouping

Grouping places related options under a labeled category header, making long lists easier to scan by creating clear visual sections within the option panel.

###### When to use

- The option list contains many items that fall into natural categories
- Category context helps users identify the right option faster

###### Guidelines

- Keep group labels concise — one to three words
- Avoid creating groups with fewer than two options

##### Icons

Icons appear alongside option text to provide additional visual context and help users distinguish between similar options at a glance.

###### When to use

- The options represent entities with recognizable icons (for example, file types or status indicators)
- The interface is dense and icons help users locate the right option more quickly

###### Guidelines

- Use icons consistently — either all options in a list have icons, or none do
- Icons should reinforce meaning, not replace option text

#### States

Dropdown selects support the following interactive states.

##### Trigger states

The trigger area reflects the following states based on user interaction and form context:

- **Unselected**: No option has been chosen; placeholder text is shown.
- **Hover**: The cursor is positioned over the trigger; a visual highlight confirms it is interactive.
- **Focus**: The control is keyboard-focused and awaiting input.
- **Active / open**: The option panel is visible.
- **Disabled**: The field is not interactive. Use only when an action within the current page can make the field available; if nothing can enable it, hide the field instead.

##### Option states

Within the open option panel, individual options display the following states:

- **Selected**: The option has been chosen; a visual indicator distinguishes it from unselected options.
- **Hover**: The cursor is over an option.

#### Behavior

##### Open and close

- Clicking or tapping the trigger opens the option panel below the field when there is sufficient space in the viewport. When the field is near the bottom of the screen, the panel opens above the trigger instead.
- The chevron icon rotates 180° when the panel opens and returns to its original orientation when it closes.
- In multi-select mode, the panel stays open after each selection so the user can pick additional options without reopening.

##### Scrolling

- When all options fit within the panel's maximum height, no scrollbar appears.

##### Typeahead

- When no options match the filter, a configurable message is displayed.
- See [Typeahead](https://booster.zywave.dev/design-system/patterns/typeahead/) for broader guidance on auto-complete and auto-suggest patterns.

##### Defaulting a selection

- A Dropdown Select should not default to a selected option on first use. Pre-selecting only makes sense when a user revisits a form to update a previously saved value.
- When "None" is a valid choice in a required field, add it as an explicit option at the top of the list — do not rely on an empty trigger state to represent "None."

#### Content guidelines

##### Option labels

Sort the option list in a logical order — alphabetically or with the most commonly selected options at the top — so users can find their choice without reading every item.

###### Effective option labels are

- Specific enough to distinguish each choice from others in the same list
- Consistent in grammatical form — all nouns, all verb phrases, or all adjectives within a single list
- Free of articles ("a", "an", "the") unless omitting them creates ambiguity

###### Writing style

- Use sentence case: "Risk management" not "Risk Management"
- Keep labels concise — three words or fewer when possible
- Lead with the most meaningful word; avoid filler at the start

#### Responsiveness

##### Mobile considerations

- For more information about mobile and touch device breakpoints, see the [breakpoints table](https://booster.zywave.dev/design-system/developers/css-guide/#breakpoints).

#### Best practices

##### Labeling

- **Do:** Use clear and concise labeling. Label text informs users what information is being requested for a Dropdown Select.
- **Don't:** Avoid using long phrases or full sentences as label text.

##### Required fields

- **Do:** Make it clear which fields are required by using a red asterisk in the label.
- **Don't:** Avoid assuming users know which fields are required and which are optional.

##### Validation

- **Do:** Show clear error messages that describe what went wrong and how to correct it.
- **Don't:** Avoid letting a validation error go unnoticed — always draw attention to fields with errors.

#### Accessibility

##### Keyboard navigation

- **Tab**: Moves focus to the Dropdown Select trigger.
- **Arrow Up / Arrow Down**: Navigates between options in the open panel.
- **Enter**: Selects the currently focused option; in multi-select mode, toggles the option's selected state.

#### Alternate considerations

Consider these alternatives when a Dropdown Select isn't the right choice.

##### When to use `<zui-radio>` instead

- There are fewer than three options and they should all remain visible without requiring the user to open a panel

##### When to use a `<zui-toggle>` instead

- The choice is binary (on/off, yes/no) — a Toggle communicates the two states more clearly than a two-option dropdown

##### When to use a `<zui-select-dropdown>` instead

- The user needs to select more than one option from the list

##### When to use a `<zui-multipicker>` instead

- Both the available pool and the selected set need to remain visible side by side — the dual-panel layout is better suited for that pattern than a dropdown

##### When to use a `<zui-picker>` instead

- The user needs to search through and select from a large, pageable dataset with results loaded from the server

### Dropdown Multi-Select

A form control for selecting one or more options from a dropdown list.

#### Usage

Dropdown Multi-Select is a form control used when users need to pick more than one option from a list. Selected items appear as removable tags inside the field, keeping all selections visible and the full option list accessible without navigating away.

##### When to use Dropdown Multi-Select

- When users need to pick more than one option from a list — for example, assigning coverage lines, roles, or categories to a record
- Filter panels where users apply multiple criteria at once — selected filters show as removable tags
- When users need to make a selection from a list with more than 10 options
- Edit forms that need to show a record's previously saved selections when the page loads

##### Don't use Dropdown Multi-Select when

- Users can only choose one option — use `<zui-select-dropdown>` instead for single-value selection
- The list has fewer than 3 items — use `<zui-checkbox>` instead to keep all options visible without a dropdown interaction
- Users need to see the full available pool and their selected set side by side — use `<zui-multipicker>` instead; its dual-panel layout is better suited for curation tasks
- The choice is binary on/off — use `<zui-toggle>` or `<zui-checkbox>` instead

#### Anatomy

A Dropdown Multi-Select consists of the following elements:

1. **Input field**: The form field where users see their selected items and click to open the option list
2. **Selection tag**: Once an option is chosen, it appears as a removable tag inside the trigger; users can remove it via the × icon on the tag
3. **Chevron**: Indicates that options are available in a dropdown list; rotates 180° when the list is open
4. **Option list**: The dropdown panel containing all available options
5. **Option**: A selectable item in the list
6. **Option checkbox**: A checkbox beside each option to indicate and toggle its selected state
7. **Scrollbar**: Appears when options exceed the visible area of the dropdown panel

#### Types

##### Standard

The standard Dropdown Multi-Select shows options in a scrollable list. Each selection appears as a dismissible tag inside the trigger. Use when the list is short enough that users can scan it without filtering.

###### When to use

- Lists of fewer than 20 options where scrolling is sufficient
- Selections that don't change frequently once saved

##### Searchable

###### When to use

- Lists of 20 or more options
- Options with long or similar names where filtering by keyword is faster than scrolling

###### Guidelines

- Set `no-results-message` to give users a clear empty-state cue when their search finds nothing
- Pair `searchable` with `debounce` when loading options from an API to prevent a network request on every keystroke

##### Grouping

Options can be organized under labeled group headers using `<zui-option-group>`. Group labels help users scan a long list by clustering related items together.

###### When to use

- The option list contains distinct categories that benefit from visual separation
- Users are likely to scan by category rather than read every option

###### Guidelines

- Use concise, descriptive group labels — one to three words
- Group labels are not selectable and are skipped by typeahead filtering
- Use `ungrouped-label` to label any options that don't belong to a named group

##### Icons

Icons can be placed inside `<zui-option>` elements to visually distinguish options when the icon adds meaning beyond the label.

###### When to use

- Options map to recognizable concepts with established icon conventions
- The list benefits from visual scanning cues alongside text labels

###### Guidelines

- Use icons consistently — either all options have icons or none do
- Never use icons as a substitute for a clear label

#### States

Dropdown Multi-Select supports the following states on the trigger: unselected, hover, focus, active, selected, and disabled.

##### Unselected

The trigger shows placeholder text when no options have been selected.

##### Hover

A visual highlight appears to indicate the trigger is interactive.

##### Focus

Appears when the trigger receives keyboard focus, awaiting user input.

##### Active

The option list is open and the user is making selections.

##### Selected

One or more options have been chosen and appear as tags inside the input field. The field remains interactive — users can open the list to add more selections or remove existing ones by clicking the × on a tag.

##### Disabled

The trigger and all options are non-interactive. Only disable the field when an in-page action will enable it — if nothing can enable it, hide it instead.

#### Option states

Within the option list, individual options support default, selected, hover, and disabled states.

###### When to use disabled options

- Communicate that an option exists but is unavailable in the current context, such as a plan feature the user has not purchased

#### Behavior

##### Open and close

- The option list opens below the trigger when there is sufficient viewport space; it opens above when the trigger is near the bottom of the screen
- The chevron rotates 180° when the list opens and returns to its original position when it closes
- Clicking outside the component closes the list; in multi-select mode the list stays open after each selection so users can pick multiple items in sequence

##### Scrolling

- The list opens below or above the trigger depending on available viewport space

##### Selection tags

- Each selected option appears as a tag inside the trigger
- Multiple tags wrap within the trigger to display all selections
- A selection can be removed by clicking the × icon on its tag, pressing Backspace while the trigger is focused, or deselecting its checkbox in the option list
- When many selections would cause the trigger to grow too tall, display a maximum of 5 individual tags and a summary tag (e.g., "and 10 more") — the summary tag must not have a × icon

##### Defaulting selections

- Do not pre-select an option by default unless restoring a previously saved state
- If no option applies and the field is required, include "None" at the top of the list as an explicit option
- Restore saved selections by setting the `selected` attribute on the matching `<zui-option>` elements at render time
- **Note:** In single-select mode, if no `placeholder` is set and no option is marked `selected`, the field automatically selects the first option in the list when it loads, the same way a native browser dropdown behaves. To show a genuinely empty field on load, always set a `placeholder`.

##### Select all

- A "Select all" option is appropriate when users commonly need every item — for example, selecting all 50 states in a coverage preferences form
- For finite lists, "Select all" selects every option individually; users can deselect items one at a time; "Select all" remains checked as long as all options are selected
- For large API-backed lists, "Select all" may need to be a magic value interpreted server-side; in this case users cannot deselect individual items — they must deselect "Select all" to reset the field

##### Option organization

- Sort options in a logical order — alphabetical is the default; place the most frequently selected options at the top when usage patterns are known
- Use `<zui-option-group>` with a label to group related options; group labels aid scanning and are not matched by typeahead filtering
- Use icons inside `<zui-option>` elements to visually distinguish options when icons add meaning beyond the label

##### Typeahead and search

- Set `no-results-message` to display a clear empty-state message when filtering returns no matches

#### Content guidelines

##### Placeholder text

###### Effective placeholder text

- Describes what the user is selecting: "Select categories...", "Choose coverage lines..."
- Uses sentence case
- Ends with an ellipsis to signal the field is interactive

###### Writing style

- Be specific — "Select states" is clearer than "Select options"
- Keep placeholder text to 3–5 words
- Avoid generic placeholder text like "Select..." when context allows something more descriptive

##### Option labels

###### Effective option labels are

- Concise — one to four words per option
- Parallel in structure — all noun phrases, not a mix of nouns and full sentences
- Distinct — no two options should be so similar they cause confusion

###### Writing style

- Use sentence case for all option labels
- Avoid leading articles ("a", "an", "the") at the start of option labels

#### Best practices

##### Labeling

- **Do:** Use clear and concise label text to communicate what users are selecting.
- **Don't:** Avoid sentences or long phrases for label text.

##### Placeholder text

- **Do:** Write specific placeholder text that describes what the user is selecting — for example, "Select coverage lines..." or "Choose roles...".
- **Don't:** Avoid generic placeholder text like "Select..." when context allows something more descriptive.

##### Icons

- **Do:** Apply icons consistently — either every option in the list has an icon, or none do.
- **Don't:** Don't mix options with and without icons in the same list — inconsistent icon use creates visual noise and implies a meaning that isn't there.

#### Accessibility

##### Keyboard navigation

- **Tab**: Move focus to the trigger
- **Arrow Down / Arrow Up**: Navigate between options in the open list
- **Escape**: Close the option list. **Note:** Known gaps — pressing Escape currently removes focus from the control entirely rather than keeping it on the trigger, and if the list has no rows to show (e.g. a search with no matches), Escape does nothing at all; use Tab or click outside to close it in that case.
- **Backspace**: Remove the last selected tag when the trigger has focus

##### Screen reader announcements

**Note:** Full ARIA listbox semantics are not yet implemented for Dropdown Multi-Select: the option list has no `role="listbox"`, and individual options and tag remove buttons have no `aria-selected`, `aria-multiselectable`, `aria-disabled`, or `aria-label`. Screen reader users currently rely on visual cues (bold text and the option checkbox) for selection state, and disabled options and removable tags are not announced as such. This is a known gap.

##### ARIA requirements

- See the note above — the option list's ARIA semantics are not yet implemented in the component

#### Alternate considerations

Consider these alternatives when Dropdown Multi-Select isn't the right choice.

##### When to use `<zui-checkbox>` instead

- The list has fewer than 3 options and fits inline — Checkboxes keep all options visible without requiring a dropdown interaction

##### When to use `<zui-select-dropdown>` instead

- Users can only choose one option from the list — Dropdown Select is designed for single-value selection and adds less complexity for simple choices

##### When to use `<zui-multipicker>` instead

- Users need to see both the full available pool and their selected set at the same time, or the list exceeds 7–10 items and requires a search-to-add interaction — Multi-Picker's dual-panel layout is better suited for curation tasks

## Examples

### Single select dropdown

```html
<zui-select-dropdown>
  <zui-option value="arizona">Arizona</zui-option>
  <zui-option value="california">California</zui-option>
  <zui-option value="colorado">Colorado</zui-option>
  <zui-option value="florida">Florida</zui-option>
  <zui-option value="georgia">Georgia</zui-option>
  <zui-option value="illinois">Illinois</zui-option>
  <zui-option value="minnesota">Minnesota</zui-option>
  <zui-option value="new-york">New York</zui-option>
  <zui-option value="ohio">Ohio</zui-option>
  <zui-option value="texas">Texas</zui-option>
  <zui-option value="washington">Washington</zui-option>
  <zui-option value="wisconsin">Wisconsin</zui-option>
</zui-select-dropdown>
```

### Single select dropdown with pre-selected option

```html
<zui-select-dropdown placeholder="Select a state">
  <zui-option value="arizona">Arizona</zui-option>
  <zui-option value="california">California</zui-option>
  <zui-option value="colorado">Colorado</zui-option>
  <zui-option value="florida">Florida</zui-option>
  <zui-option value="georgia">Georgia</zui-option>
  <zui-option value="illinois" selected>Illinois</zui-option>
  <zui-option value="minnesota">Minnesota</zui-option>
  <zui-option value="new-york">New York</zui-option>
  <zui-option value="ohio">Ohio</zui-option>
  <zui-option value="texas">Texas</zui-option>
  <zui-option value="washington">Washington</zui-option>
  <zui-option value="wisconsin">Wisconsin</zui-option>
</zui-select-dropdown>
```

### Multi-select dropdown

```html
<zui-select-dropdown multiple>
  <zui-option value="general-liability">General liability</zui-option>
  <zui-option value="workers-compensation">Workers' compensation</zui-option>
  <zui-option value="commercial-auto">Commercial auto</zui-option>
  <zui-option value="commercial-property">Commercial property</zui-option>
  <zui-option value="cyber-liability">Cyber liability</zui-option>
  <zui-option value="professional-liability">Professional liability</zui-option>
</zui-select-dropdown>
```

### Multi-select dropdown with pre-selected options

```html
<zui-select-dropdown placeholder="Select coverage lines" multiple>
  <zui-option value="general-liability" selected>General liability</zui-option>
  <zui-option value="workers-compensation">Workers' compensation</zui-option>
  <zui-option value="commercial-auto" selected>Commercial auto</zui-option>
  <zui-option value="commercial-property">Commercial property</zui-option>
  <zui-option value="cyber-liability" selected>Cyber liability</zui-option>
  <zui-option value="professional-liability">Professional liability</zui-option>
</zui-select-dropdown>
```

### Multi-select dropdown with truncation

```html
<zui-select-dropdown multiple maximum-results-display-count="5" truncated-result-message-format="{0} more">
  <zui-option value="arizona" selected>Arizona</zui-option>
  <zui-option value="california" selected>California</zui-option>
  <zui-option value="colorado" selected>Colorado</zui-option>
  <zui-option value="florida" selected>Florida</zui-option>
  <zui-option value="georgia" selected>Georgia</zui-option>
  <zui-option value="illinois" selected>Illinois</zui-option>
  <zui-option value="minnesota">Minnesota</zui-option>
  <zui-option value="new-york">New York</zui-option>
  <zui-option value="ohio">Ohio</zui-option>
  <zui-option value="texas">Texas</zui-option>
  <zui-option value="washington">Washington</zui-option>
  <zui-option value="wisconsin">Wisconsin</zui-option>
</zui-select-dropdown>
```

### Select dropdown with placeholder

```html
<zui-select-dropdown placeholder="Select a state">
  <zui-option value="arizona">Arizona</zui-option>
  <zui-option value="california">California</zui-option>
  <zui-option value="colorado">Colorado</zui-option>
  <zui-option value="florida">Florida</zui-option>
  <zui-option value="georgia">Georgia</zui-option>
  <zui-option value="illinois">Illinois</zui-option>
  <zui-option value="minnesota">Minnesota</zui-option>
  <zui-option value="new-york">New York</zui-option>
  <zui-option value="ohio">Ohio</zui-option>
  <zui-option value="texas">Texas</zui-option>
  <zui-option value="washington">Washington</zui-option>
  <zui-option value="wisconsin">Wisconsin</zui-option>
</zui-select-dropdown>
```

### Searchable select dropdown

```html
<zui-select-dropdown placeholder="Search states" multiple searchable typeahead>
  <zui-option value="arizona">Arizona</zui-option>
  <zui-option value="california">California</zui-option>
  <zui-option value="colorado">Colorado</zui-option>
  <zui-option value="florida">Florida</zui-option>
  <zui-option value="georgia">Georgia</zui-option>
  <zui-option value="illinois">Illinois</zui-option>
  <zui-option value="minnesota">Minnesota</zui-option>
  <zui-option value="new-york">New York</zui-option>
  <zui-option value="ohio">Ohio</zui-option>
  <zui-option value="texas">Texas</zui-option>
  <zui-option value="washington">Washington</zui-option>
  <zui-option value="wisconsin">Wisconsin</zui-option>
</zui-select-dropdown>
```

### Searchable select dropdown with 1000ms debounce

```html
<zui-select-dropdown placeholder="Search states" multiple searchable debounce="1000">
  <zui-option value="arizona">Arizona</zui-option>
  <zui-option value="california">California</zui-option>
  <zui-option value="colorado">Colorado</zui-option>
  <zui-option value="florida">Florida</zui-option>
  <zui-option value="georgia">Georgia</zui-option>
  <zui-option value="illinois">Illinois</zui-option>
  <zui-option value="minnesota">Minnesota</zui-option>
  <zui-option value="new-york">New York</zui-option>
  <zui-option value="ohio">Ohio</zui-option>
  <zui-option value="texas">Texas</zui-option>
  <zui-option value="washington">Washington</zui-option>
  <zui-option value="wisconsin">Wisconsin</zui-option>
</zui-select-dropdown>
```

### Grouped select dropdown options

```html
<zui-select-dropdown placeholder="Select a state">
  <zui-option-group label="Midwest">
    <zui-option value="illinois">Illinois</zui-option>
    <zui-option value="minnesota">Minnesota</zui-option>
    <zui-option value="ohio">Ohio</zui-option>
    <zui-option value="wisconsin">Wisconsin</zui-option>
  </zui-option-group>
  <zui-option-group label="Northeast">
    <zui-option value="new-york">New York</zui-option>
    <zui-option value="pennsylvania">Pennsylvania</zui-option>
  </zui-option-group>
  <zui-option-group label="South">
    <zui-option value="florida">Florida</zui-option>
    <zui-option value="georgia">Georgia</zui-option>
    <zui-option value="texas">Texas</zui-option>
  </zui-option-group>
  <zui-option-group label="West">
    <zui-option value="arizona">Arizona</zui-option>
    <zui-option value="california">California</zui-option>
    <zui-option value="colorado">Colorado</zui-option>
    <zui-option value="washington">Washington</zui-option>
  </zui-option-group>
</zui-select-dropdown>
```

### Select dropdown options with icons

```html
<zui-select-dropdown placeholder="Select team members" multiple>
  <zui-option-group label="Finance">
    <zui-option value="jordan-lee"><zui-icon icon="zui-user"></zui-icon>Jordan Lee</zui-option>
    <zui-option value="priya-patel"><zui-icon icon="zui-user"></zui-icon>Priya Patel</zui-option>
  </zui-option-group>
  <zui-option-group label="Operations">
    <zui-option value="marcus-johnson"><zui-icon icon="zui-user"></zui-icon>Marcus Johnson</zui-option>
    <zui-option value="elena-garcia"><zui-icon icon="zui-user"></zui-icon>Elena Garcia</zui-option>
  </zui-option-group>
  <zui-option-group label="Sales">
    <zui-option value="sam-chen"><zui-icon icon="zui-user"></zui-icon>Sam Chen</zui-option>
    <zui-option value="avery-brooks"><zui-icon icon="zui-user"></zui-icon>Avery Brooks</zui-option>
  </zui-option-group>
</zui-select-dropdown>
```

### Select dropdown with disabled options

```html
<zui-select-dropdown placeholder="Select a coverage line">
  <zui-option value="general-liability">General liability</zui-option>
  <zui-option value="workers-compensation">Workers' compensation</zui-option>
  <zui-option value="commercial-auto" disabled>Commercial auto</zui-option>
  <zui-option value="commercial-property">Commercial property</zui-option>
  <zui-option value="cyber-liability" disabled>Cyber liability</zui-option>
  <zui-option value="professional-liability">Professional liability</zui-option>
</zui-select-dropdown>
```

### Disabled select dropdown

```html
<zui-select-dropdown placeholder="Select a payment frequency" disabled>
  <zui-option value="monthly">Monthly</zui-option>
  <zui-option value="quarterly">Quarterly</zui-option>
  <zui-option value="annually" selected>Annually</zui-option>
</zui-select-dropdown>
```

### Extra small select dropdown

```html
<zui-select-dropdown class="xsmall">
  <zui-option value="10">10</zui-option>
  <zui-option value="25">25</zui-option>
  <zui-option value="50">50</zui-option>
  <zui-option value="100">100</zui-option>
</zui-select-dropdown>
```

### Small select dropdown

```html
<zui-select-dropdown class="small">
  <zui-option value="monthly">Monthly</zui-option>
  <zui-option value="quarterly">Quarterly</zui-option>
  <zui-option value="annually">Annually</zui-option>
</zui-select-dropdown>
```

### Medium select dropdown

```html
<zui-select-dropdown class="medium">
  <zui-option value="finance">Finance</zui-option>
  <zui-option value="human-resources">Human resources</zui-option>
  <zui-option value="operations">Operations</zui-option>
  <zui-option value="sales">Sales</zui-option>
</zui-select-dropdown>
```

### Large select dropdown

```html
<zui-select-dropdown class="large">
  <zui-option value="general-liability">General liability</zui-option>
  <zui-option value="workers-compensation">Workers' compensation</zui-option>
  <zui-option value="commercial-auto">Commercial auto</zui-option>
  <zui-option value="commercial-property">Commercial property</zui-option>
  <zui-option value="cyber-liability">Cyber liability</zui-option>
  <zui-option value="professional-liability">Professional liability</zui-option>
</zui-select-dropdown>
```

### Valid select dropdown

```html
<zui-select-dropdown class="is-valid">
  <zui-option value="finance">Finance</zui-option>
  <zui-option value="human-resources">Human resources</zui-option>
  <zui-option value="operations" selected>Operations</zui-option>
  <zui-option value="sales">Sales</zui-option>
</zui-select-dropdown>
```

### Invalid select dropdown

```html
<zui-select-dropdown class="is-invalid">
  <zui-option value="finance">Finance</zui-option>
  <zui-option value="human-resources">Human resources</zui-option>
  <zui-option value="operations">Operations</zui-option>
  <zui-option value="sales" selected>Sales</zui-option>
</zui-select-dropdown>
```

### Required select dropdown

```html
<zui-select-dropdown placeholder="Select at least one department" multiple required>
  <zui-option value="finance">Finance</zui-option>
  <zui-option value="human-resources">Human resources</zui-option>
  <zui-option value="operations">Operations</zui-option>
  <zui-option value="sales">Sales</zui-option>
</zui-select-dropdown>
```

### Multi-select dropdown with select all option

```html
<zui-select-dropdown multiple enable-select-all select-all-option-label="Select all">
  <zui-option value="general-liability">General liability</zui-option>
  <zui-option value="workers-compensation">Workers' compensation</zui-option>
  <zui-option value="commercial-auto">Commercial auto</zui-option>
  <zui-option value="commercial-property">Commercial property</zui-option>
  <zui-option value="cyber-liability">Cyber liability</zui-option>
  <zui-option value="professional-liability">Professional liability</zui-option>
</zui-select-dropdown>
```

### Multi-select dropdown with select all option that overrides all other selected values

```html
<zui-select-dropdown multiple enable-select-all select-all-option-label="Select all" enable-select-all-override select-all-option-value="&lt;ALL&gt;" select-all-result-label="All selected">
  <zui-option value="general-liability">General liability</zui-option>
  <zui-option value="workers-compensation">Workers' compensation</zui-option>
  <zui-option value="commercial-auto">Commercial auto</zui-option>
  <zui-option value="commercial-property">Commercial property</zui-option>
  <zui-option value="cyber-liability">Cyber liability</zui-option>
  <zui-option value="professional-liability">Professional liability</zui-option>
</zui-select-dropdown>
```

### Multi-select dropdown with select all option and truncation

```html
<zui-select-dropdown multiple enable-select-all select-all-option-label="Select all" maximum-results-display-count="5" truncated-result-message-format="{0} more">
  <zui-option value="arizona" selected>Arizona</zui-option>
  <zui-option value="california" selected>California</zui-option>
  <zui-option value="colorado" selected>Colorado</zui-option>
  <zui-option value="florida" selected>Florida</zui-option>
  <zui-option value="georgia" selected>Georgia</zui-option>
  <zui-option value="illinois" selected>Illinois</zui-option>
  <zui-option value="minnesota">Minnesota</zui-option>
  <zui-option value="new-york">New York</zui-option>
  <zui-option value="ohio">Ohio</zui-option>
  <zui-option value="texas">Texas</zui-option>
  <zui-option value="washington">Washington</zui-option>
  <zui-option value="wisconsin">Wisconsin</zui-option>
</zui-select-dropdown>
```

### Select dropdown custom styles with shadow part

Use ::part(control) to style the dropdown control; this example slows the focus border transition.

```html
<style>
  .custom-select-dropdown::part(control) {
    transition:
      border 1000ms ease-in-out,
      box-shadow 1000ms ease-in-out;
  }
</style>
<zui-select-dropdown class="custom-select-dropdown">
  <zui-option value="finance">Finance</zui-option>
  <zui-option value="human-resources">Human resources</zui-option>
  <zui-option value="operations">Operations</zui-option>
  <zui-option value="sales" selected>Sales</zui-option>
</zui-select-dropdown>
```

### Async select dropdown with queryHandler

```html
<zui-select-dropdown id="async-industry-select" placeholder="Search NAICS codes..." searchable></zui-select-dropdown>
<script type="module">
  const industries = [
    { value: "11", label: "11 - Agriculture, Forestry, Fishing and Hunting" },
    { value: "21", label: "21 - Mining, Quarrying, and Oil and Gas Extraction" },
    { value: "22", label: "22 - Utilities" },
    { value: "23", label: "23 - Construction" },
    { value: "31-33", label: "31-33 - Manufacturing" },
    { value: "42", label: "42 - Wholesale Trade" },
    { value: "44-45", label: "44-45 - Retail Trade" },
    { value: "48-49", label: "48-49 - Transportation and Warehousing" },
    { value: "51", label: "51 - Information" },
    { value: "52", label: "52 - Finance and Insurance" },
    { value: "53", label: "53 - Real Estate and Rental and Leasing" },
    { value: "54", label: "54 - Professional, Scientific, and Technical Services" },
    { value: "55", label: "55 - Management of Companies and Enterprises" },
    { value: "56", label: "56 - Administrative and Support and Waste Management and Remediation Services" },
    { value: "61", label: "61 - Educational Services" },
    { value: "62", label: "62 - Health Care and Social Assistance" },
    { value: "71", label: "71 - Arts, Entertainment, and Recreation" },
    { value: "72", label: "72 - Accommodation and Food Services" },
    { value: "81", label: "81 - Other Services (except Public Administration)" },
    { value: "92", label: "92 - Public Administration" },
  ];

  async function searchIndustries(query, options) {
    return new Promise((resolve) => {
      setTimeout(() => {
        if (!query) {
          resolve(industries);
        } else {
          const filtered = industries.filter((industry) => industry.label.toLowerCase().includes(query.toLowerCase()));
          resolve(filtered);
        }
      }, 300);
    });
  }

  const dropdown = document.getElementById("async-industry-select");
  dropdown.queryHandler = searchIndustries;
</script>
```

## API reference

If this section and the content above disagree, this section is correct.

### `<zui-select-dropdown>`

Class: `ZuiSelectDropdownElement`

`<zui-select-dropdown>` is an evolved `<zui-select>` that supports multiselect, typeahead, tagging, grouping, and asynchronous option retrieval. Great for longer imperatively created lists.

#### Attributes

- `name` (default: `null`): `string | null`. The name of this element that is associated with form submission
- `disabled` (default: `false`): `boolean`. Represents whether a user can make changes to this element; if true, the value of this element will be excluded from the form submission
- `readonly` (default: `false`): `boolean`. Represents whether a user can make changes to this element; the value of this element will still be included in the form submission
- `autofocus` (default: `false`): `boolean`. If true, this element will be focused when connected to the document
- `placeholder` (reflects, default: `null`): `string | null`. Text to show within input when no options selected
- `multiple` (reflects, default: `false`): `boolean`. Allow multiple options to be selected
- `searchable` (reflects, default: `false`): `boolean`. Allow typing a search term within the input to filter options
- `debounce` (reflects, default: `null`): `number | null`. Delay in milliseconds after typing before retrieving options
- `typeahead` (reflects, default: `false`): `boolean`. Emphasize parts of the option text after typing that were not typed
- `taggable` (reflects, default: `false`): `boolean`. Allow creating the desired option after typing if no option matches the search term
- `taggable-label` (property: `taggableLabel`, reflects, default: `'Create'`): `string`. Text to show on the taggable option before the search term
- `ungrouped-label` (property: `ungroupedLabel`, reflects, default: `null`): `string | null`. Only applicable when labelling option groups. If there are options untied to a group label, file under this label; defaults to "Other" if null.
- `no-results-message` (property: `noResultsMessage`, reflects, default: `null`): `string | null`. The message to appear if a group contains no options
- `hide-empty-groups` (property: `hideEmptyGroups`, reflects, default: `false`): `boolean`. Hide group and no results message if there are no options
- `required` (default: `false`): `boolean`. If set, can provide hints to form validation and prevent users from clearing out a single select
- `enable-select-all` (property: `enableSelectAll`): `boolean`. When enabled, the "Select all" feature can be utilized. Note: this only applies when `multiple` is true
- `select-all-option-label` (property: `selectAllOptionLabel`, default: `null`): `string | null`. Provides the user-facing text in the dropdown list for the "Select all" option.
  Required when allowing a user to select all options with `enable-select-all` / `enableSelectAll`.
- `select-all-result-label` (property: `selectAllResultLabel`, default: `null`): `string | null`. Provides the user-facing text in the result container when the "Select all" option is selected.
  Required when allowing a user to select all options with `enable-select-all` / `enableSelectAll`.
- `select-all-option-value` (property: `selectAllOptionValue`, default: `null`): `string | null`. Optional property used alongside `enable-select-all` / `enableSelectAll` to control the value selected when "Select all" is selected.
  If set, and the user has selected all value, the value of this property will be included in the selection list.
- `enable-select-all-override` (property: `enableSelectAllOverride`): `boolean`. When enabled, when a user indicates to "select all", then all options will be selected,
  the `selectAllResultLabel` will be rendered alone in the result container, and the user will be unable to deselect individual options until they deselect "select all".
- `maximum-results-display-count` (property: `maximumResultsDisplayCount`, default: `5`): `number`. Controls the maximum number of results to display in the result container.
  Must be used with `truncated-result-message-format` / `truncatedResultMessageFormat`.
- `truncated-result-message-format` (property: `truncatedResultMessageFormat`, default: `null`): `string | null`. Controls how the truncated result option is rendered.
  Can use `{0}` to merge in the number of results that were not displayed.

#### Properties

- `queryHandler`: `QueryHandlerCallback | undefined`. An alternative or supplementary way to retrieve options. Must be a function that accepts a string argument and an optional array argument of `ZuiOptionObject` elements. Must return an array or a `Promise` of an array of strings or objects with a `label` property and optional `value`, `disabled`, and/or `group` properties. The search term will be passed to the first argument and the existing options will be passed to the second argument.
- `allSelected` (readonly): `boolean`. Determines if all options are selected
- `type` (readonly): `string`
- `options` (readonly): `ZuiOptionElement[]`
- `value`: `string`
- `selectedOptions` (readonly). Returns the selected options as an array of `ZuiOptionObject` objects. See https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement/selectedOptions | selectedOptions for browser-native documentation.
- `name` (default: `null`): `string | null`. The name of this element that is associated with form submission
- `disabled` (default: `false`): `boolean`. Represents whether a user can make changes to this element; if true, the value of this element will be excluded from the form submission
- `readOnly` (default: `false`): `boolean`. Represents whether a user can make changes to this element; the value of this element will still be included in the form submission
- `autofocus` (default: `false`): `boolean`. If true, this element will be focused when connected to the document

#### Methods

- `item(index: number): ZuiOptionElement | null`. Return a `ZuiOptionElement` based upon number index value passed in
- `clear()`. Clears all selected options
- `showPicker()`. Opens the dropdown. See https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/showPicker | showPicker for browser-native comparisons.

#### Events

- `tag`: `CustomEvent`. Event dispatches on new option tagged; event contains `value` details
- `query`: `CustomEvent`. Event dispatches on search term typed in the input. If debounce > 0, only fires after timeout; event contains `value` details
- `change`: `CustomEvent<string | string[] | null>`. Event dispatches on selected option(s) changed; `event.detail` is the selected value string, or an array of value strings when `multiple` is set

#### Slots

- (default). Default, unnamed slot; for inserting `<zui-option>` or `<zui-option-group>` elements into `<zui-select-dropdown>`

#### CSS parts

- `control`. For custom styling of the underlying select control; this is exposed as a CSS shadow part and can be accessed with `::part(control)`

### `<zui-option>`

Class: `ZuiOptionElement`

Use to create a selectable option that can be used within `<zui-select>` or `<zui-select-dropdown>`.

#### Attributes

- `value` (reflects, default: `undefined`): `string | null | undefined`. Sets a `value` for the option
- `label` (default: `''`): `string`. The label users will see as a choice, in a select dropdown
- `disabled` (reflects, default: `false`): `boolean`. Options `disabled` state
- `hidden` (default: `false`): `boolean`. Whether to hide the option from the list or not
- `selected` (reflects, default: `false`): `boolean`. Determines if the `zui-option` is selected

#### Events

- `updated`: `CustomEvent`. Event is dispatched when `<zui-option>` is updated; contains details regarding what properties changed
- `selectedchange`: `CustomEvent`. Event is dispatched when `<zui-option>` is selected or deselected; contains details regarding the `selected` state

#### Slots

- (default). Default, unnamed slot; for inserting label text into `<zui-option>`; optionally, you can use the `label` attribute/property instead

### `<zui-option-group>`

Class: `ZuiOptionGroupElement`

Functions as a way to create category labels for grouping similar options in `<zui-select-dropdown>`.

#### Attributes

- `label` (reflects, default: `''`): `string`. The group or category label, for selectable options

#### Slots

- (default). Default, unnamed slot; for inserting `<zui-option>` elements into a `<zui-option-group>` in order to group them under a single label
