terra-search-field
Version:
A search component with a field that automatically performs a search callback after user input.
14 lines • 1.32 kB
Markdown
## SearchField Props Table
| Prop Name | Type | Is Required | Default Value | Description |
|-|-|-|-|-|
| defaultValue| `string`| optional| `undefined`| The defaultValue of the search field. Use this to create an uncontrolled search field.|
| disableAutoSearch| `bool`| optional| `false`| When true, will disable the auto-search.|
| isBlock| `bool`| optional| `false`| Whether or not the field should display as a block.|
| isDisabled| `bool`| optional| `false`| When true, will disable the field.|
| minimumSearchTextLength| `number`| optional| `2`| The minimum number of characters to perform a search.|
| onChange| `func`| optional| | Function to trigger when user changes the input value. Provide a function to create a controlled input.|
| onInvalidSearch| `func`| optional| | A callback to indicate an invalid search. Sends parameter {String} searchText.|
| onSearch| `func`| optional| | A callback to perform search. Sends parameter {String} searchText.|
| placeholder| `string`| optional| `''`| Placeholder text to show while the search field is empty.|
| searchDelay| `number`| optional| `250`| How long the component should wait (in milliseconds) after input before performing an automatic search.|
| value| `string`| optional| `undefined`| The value of search field. Use this to create a controlled search field.|