Sorry, but you either have no stories or none are selected somehow.
If the problem persists, check the browser console, or the terminal you've run Storybook from.
The search component should be used for searching contents within a website or an app. We can have 2 types of search components: Standard and Inline.
It's a standard input linked to a search button. It should be used when the design needs more emphasis in the search funcionality. This search suggests results in an autocomplete dropdown and, for more detailed answers, it can take the user to another page.
Similar to the text with trailing icon input. It should be used when the design needs a more compact and clean component. This search works filtering the results and showing them simultaneously as the user types.
Go to Setup for instructions on how to import the component.
Name | Description | Default |
---|---|---|
id | Text that will serve as unique identifier. It's also an important accessibility tool. string | - |
defaultValue | Defines a default value for the Search initialization. string | - |
ariaDisabled | Disables the Search. Will be read by screen readers. When true, will override disabled .bool | false |
disabled | Disables the Search. Won't be read by screen readers. bool | false |
value | Text that will be rendered inside the Search field. string | - |
onChange | Action to be executed when the Search default value changes. func | () => {} |
onSearch | Action to be executed when the search is performed. func | () => {} |
onClear | Action to be executed when the Search is cleared out. func | () => {} |
placeholder | The placeholder text when the Search field is empty. Usually used to describe the values accepted (e.g.: Search by keyword or status). string | "Search" |
ESC
key also clears the input value.ESC
key to clear the input value.For Search component, you can also use purple theme. The theme must be selected by changing the value of the $input-theme
variable in the scss/variables/_settings.scss
.