import { SearchField } from "@opengovsg/oui"<SearchField aria-label="Search" />The SearchField component provides an accessible search input with a built-in search icon and clear button. The clear button automatically appears when the field has a value and hides when empty.
If the component does not have a visible label (by passing a label prop), an aria-label or aria-labelledby prop must be passed instead to identify it to assistive technology.
Provide clear instructions to users with labels and descriptions.
Combine isInvalid and errorMessage props to show validation errors.
Use the isDisabled prop to disable the search field.
Use the size prop to change the size of the field. Defaults to "md".
Use the inputProps prop to pass additional props to the underlying input element, such as a placeholder.
Use the searchIcon prop to replace the default search icon with a custom one.
Set the searchIcon prop to null to hide the icon entirely.
Use the value and onChange props to control the input value. The onSubmit callback is invoked when the user presses Enter.
Input value: –
Submitted value: –