Combobox
Combobox combines a text input with a list of suggested values
Combobox
wraps Reach UI's Combobox
component with default styling and accepts all the same props. See the Reach UI docs for details.
Arbitrary components can be nested inside the Combobox.Popover
to allow for more advanced usecases, e.g. adding a new value to the list of suggestions
Note that when combined with a Label
, the id
that matches the Label
's htmlFor
prop should go on the Combobox.Input
.
Edit me!
API Reference
Combobox
Prop | Type | Default | Required |
---|---|---|---|
as | JSX.IntrinsicElements | - | - |
aria-label | string | - | - |
aria-labelledby | string | - | - |
onSelect | (value: string) => void | - | - |
openOnFocus | boolean | - | - |
css | CSSProperties | - | - |
Combobox.Input
Prop | Type | Default | Required |
---|---|---|---|
value | string | - | - |
selectOnClick | boolean | - | - |
autocomplete | boolean | - | - |
state | "error" | - | - |
as | JSX.IntrinsicElements | - | - |
css | CSSProperties | - | - |
Combobox.Popover
Prop | Type | Default | Required |
---|---|---|---|
position | Position | - | - |
hidden | boolean | - | - |
targetRef | RefObject<PossibleNode> | - | - |
unstable_observableRefs | RefObject<PossibleNode>[] | - | - |
portal | boolean | - | - |
as | JSX.IntrinsicElements | - | - |
css | CSSProperties | - | - |
Combobox.List
Prop | Type | Default | Required |
---|---|---|---|
persistSelection | boolean | - | - |
as | JSX.IntrinsicElements | - | - |
css | CSSProperties | - | - |
Combobox.Option
Prop | Type | Default | Required |
---|---|---|---|
value | string | - | |
children | null | string | number | false | true | {} | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | (props: ComboboxOptionContextValue) => ReactNode | - | - |
index | number | - | - |
as | JSX.IntrinsicElements | - | - |
css | CSSProperties | - | - |
Combobox.OptionText
Prop | Type | Default | Required |
---|