Zazz Design Framework
Components

Autocomplete

An input that suggests options as you type, ranked by match quality.

A <ui-autocomplete> wraps a .ui-input and an anchored suggestion panel (popover="manual"). The input holds the form value (free text allowed) and typing filters the panel options using the cmdk ranking algorithm. Arrow keys move the highlight without moving focus out of the input (aria-activedescendant). Pressing Enter or clicking commits a suggestion into the input. Groups hide automatically when all their options filter out, and the empty slot appears when nothing matches. Without JavaScript, the markup renders as a regular text input.

Omit the popover attribute on the panel for an inline, always-open list (no floating surface or dismissal; filtering unchanged).

Default

Loading components…

Groups and score ranking

data-sort="score" re-ranks visible options by match quality using CSS order without altering the DOM tree. data-keywords adds extra search keywords to an option.

Loading components…

API

AttributeTargetValues
data-sortRootscore: rank by match (default: DOM order)
data-min-lengthRootQuery length before the panel opens (default 0)
data-value[data-slot="autocomplete-item"]Match/commit text (default: text content)
data-keywords[data-slot="autocomplete-item"]Space-separated extra match targets
data-side / data-align[data-slot="autocomplete-panel"]Placement (popover matrix)

On this page