SearchInput
Search input over InputGroup: a search icon, a built-in clear button that
appears once the field has a value, and an optional keyboard-shortcut hint
shown while it's empty. Pass suggestions for an animated "Try: …"
placeholder that cycles while the field is empty.
Import from "@instruments/materia-ui/components/search-input".
Usage
Best practices
Use
SearchInputfor search/filter fields - it supplies the search icon, a clear button, and (viashortcutHint) aKbdhint; don't rebuild these on a plainInput.onChangereceives the next string on every keystroke and on clear (not a DOM event) - passvaluefor controlled use ordefaultValuefor uncontrolled.Pass cycling placeholder ideas via
suggestions(which suppresses the staticplaceholder);shortcutHintshows only while empty and is swapped for the clear button once the field has a value.Pill (
radius="full") at the 48pxxldefault is the search signature - so leave both defaults alone in standard search/filter placements; passsizeexplicitly for compact embedded contexts (popovers, table headers).
Props
Also exports
- type
SearchInputProps
Composition
Builds on
Flex, Grid, InputGroup, Kbd