The icon to render before the input text
SearchInput
A search input type component.
Import#
import { SearchInput } from '@saas-ui/react'
Usage#
Basic#
<SearchInput placeholder="Search" />
Controlled#
function Search() {const [value, setValue] = React.useState('')return (<SearchInputplaceholder="Search"value={value}onChange={(e) => setValue(e.target.value)}onReset={() => setValue('')}/>)}
Props#
icon
icon
Description
Type
React.ReactElement
onReset
onReset
Description
Callback to trigger when the reset button is clicked or escape key is pressed
Type
(() => void)
placeholder
placeholder
Description
The placeholder text for the input
Type
string
Default
Search
resetIcon
resetIcon
Description
The icon to render in the reset button
Type
React.ReactElement
rightElement
rightElement
Description
Right element rendered when the value is empty
Type
React.ReactElement
Was this helpful?