Basic search field
Use EuiFieldSearch to allow users to enter search queries. This component renders a basic HTML
<input type="search">
element.Use the
EuiFormRow component to easily and accessibly associate form components with labels, help text, and error text.Searching on enter key
Use the onSearch
callback prop to receive EuiFieldSearch's current value when a user triggers a search via the Enter key.
Incremental search
To search as the user types into the field, set the incremental
prop to true
.
Props
EuiFieldSearch
Prop | Description and type | Default value |
---|---|---|
Prop append# | Description and type Creates an input group with element(s) coming after input. PrependAppendType | Default value |
Prop value# | Description and type Type: string | Default value |
Prop className# | Description and type Type: string | Default value |
Prop id# | Description and type Type: string | Default value |
Prop prepend# | Description and type Creates an input group with element(s) coming before input PrependAppendType | Default value |
Prop name# | Description and type Type: string | Default value |
Prop css# | Description and type Type: Interpolation<Theme> | Default value |
Prop fullWidth# | Description and type Expand to fill 100% of the parent. boolean | Default value false |
Prop isLoading# | Description and type Type: boolean | Default value |
Prop aria-label# | Description and type Type: string | Default value |
Prop data-test-subj# | Description and type Type: string | Default value |
Prop compressed# | Description and type when boolean | Default value |
Prop inputRef# | Description and type Type: (node: HTMLInputElement) => void | Default value |
Prop placeholder# | Description and type Type: string | Default value |
Prop isInvalid# | Description and type Type: boolean | Default value |
Prop isClearable# | Description and type Shows a button that quickly clears any input boolean | Default value |
Prop onSearch# | Description and type Called when the user presses [Enter] OR on change if the incremental prop is (value: string) => void | Default value |
Prop incremental# | Description and type When boolean | Default value |
Prop ref# | Description and type Allows getting a ref to the component instance. LegacyRef<unknown> | Default value |