Autocomplete
An input that suggests options as you type.
Usage guidelines
- Avoid when selection state is needed: Use Combobox instead of Autocomplete if the selection should be remembered and the input can't hold custom text. Unlike Combobox, Autocomplete's input can contain free-form text, as its suggestions only optionally complete the text.
- Form controls must have an accessible name: Give it one with a
<label>element or the Field parts. - Closing animations: The popup stays rendered until its closing animation finishes. See Animation.
Anatomy
Import the primitives and assemble the parts:
@using Blazix.Primitives
<AutocompleteRoot>
<AutocompleteInputGroup>
<AutocompleteInput />
<AutocompleteTrigger />
<AutocompleteIcon />
<AutocompleteClear />
<AutocompleteValue />
</AutocompleteInputGroup>
<AutocompletePortal>
<AutocompleteBackdrop />
<AutocompletePositioner>
<AutocompletePopup>
<AutocompleteArrow />
<AutocompleteStatus />
<AutocompleteEmpty />
<AutocompleteList>
<AutocompleteRow>
<AutocompleteItem />
</AutocompleteRow>
<AutocompleteSeparator />
<AutocompleteGroup>
<AutocompleteGroupLabel />
</AutocompleteGroup>
<AutocompleteCollection />
</AutocompleteList>
</AutocompletePopup>
</AutocompletePositioner>
</AutocompletePortal>
</AutocompleteRoot>API Reference
AutocompleteRoot
Doesn't render its own HTML element.
AutocompleteTrigger
Renders a <button> element.
Other attributes are passed to the element it renders.
AutocompleteValue
Renders a <span> element.
Other attributes are passed to the element it renders.
AutocompleteInput
Renders a <input> element.
Other attributes are passed to the element it renders.
AutocompleteIcon
Renders a <span> element.
Other attributes are passed to the element it renders.
AutocompleteClear
Renders a <button> element.
Other attributes are passed to the element it renders.
AutocompleteList
Renders a <div> element.
Other attributes are passed to the element it renders.
AutocompletePortal
Doesn't render its own HTML element.
AutocompleteBackdrop
Renders a <div> element.
Other attributes are passed to the element it renders.
AutocompletePositioner
Doesn't render its own HTML element.
AutocompletePopup
Renders a <div> element.
Other attributes are passed to the element it renders.
AutocompleteArrow
Renders a <div> element.
Other attributes are passed to the element it renders.
AutocompleteItem
Renders a <div> element.
Other attributes are passed to the element it renders.
AutocompleteGroup
Renders a <div> element.
Other attributes are passed to the element it renders.
AutocompleteGroupLabel
Renders a <div> element.
Other attributes are passed to the element it renders.
AutocompleteSeparator
Renders a <div> element.
Other attributes are passed to the element it renders.
AutocompleteStatus
Renders a <div> element.
Other attributes are passed to the element it renders.
AutocompleteEmpty
Renders a <div> element.
Other attributes are passed to the element it renders.
AutocompleteCollection
Doesn't render its own HTML element.
AutocompleteRow
Renders a <div> element.
Other attributes are passed to the element it renders.
AutocompleteInputGroup
Renders a <div> element.
Other attributes are passed to the element it renders.