Component docs
Loading
"use client";
import { Autocomplete } from "@pixxl-tools/components";| Prop | Type | Default | Description |
|---|---|---|---|
options (required) | readonly ComboboxItem<Option>[] | — | Options and groups ({ label, options }). |
autoHighlight | boolean | true | Make the first matching option active while typing (default true). |
clearable | boolean | — | Show a clear button while there is a value or text. |
clearLabel | string | from the catalog | Accessible name of the clear button (default from the catalog). |
closeOnSelect | boolean | true | Close after a selection (default: true, false with multiple). |
container | HTMLElement | null | document.body | Portal container (default document.body). |
defaultInputValue | string | — | Initial input text when uncontrolled. |
defaultOpen | boolean | — | Initial open state when uncontrolled. |
defaultValue | Value | — | Initial value when uncontrolled. |
disabled | boolean | — | Disables interaction. |
optionsrequiredreadonly ComboboxItem<Option>[]
Options and groups ({ label, options }).
autoHighlightdefault trueboolean
Make the first matching option active while typing (default true).
clearableboolean
Show a clear button while there is a value or text.
clearLabeldefault from the catalogstring
Accessible name of the clear button (default from the catalog).
closeOnSelectdefault trueboolean
Close after a selection (default: true, false with multiple).
containerdefault document.bodyHTMLElement | null
Portal container (default document.body).
defaultInputValuestring
Initial input text when uncontrolled.
defaultOpenboolean
Initial open state when uncontrolled.
defaultValueValue
Initial value when uncontrolled.
disabledboolean
Disables interaction.
const options = [
{ label: "candraw", value: "candraw" },
{ label: "cantext", value: "cantext" },
];
<Autocomplete options={options} />