Autocomplete Container
Displays a selection of relevant options based on current user input. An inline Loader can be displayed while the results are being returned from an api for the list display.
Installation
Install
yarn add @iag/chroma-react-ui.components
Import
import { AutocompleteContainer } from '@iag/chroma-react-ui.components';
Default
The following example has a small set of example towns set in the values prop, type a
or b
to see the options displayed.
The onChange
, onClear
and onBlur
are working by default to populate and clear the <Input />
.
Loading State
AutocompleteContainer can display a loading icon while data is being fetched.
Error
Valid
Disabled
AutocompleteContainer can be displayed in a disabled state.
Properties
Name
Description
- classNamestring
- disabledboolean
- errorboolean
- idstring
- labelstring
- loadingboolean
- name*string
- options*IOptions[]
- onSelect*(e: IOptions) => void
- onBlur() => void
- onFocus() => void
- placeholderstring
- validboolean
- valuestring
- requiredboolean