Searchbar
Imports
import {Searchbar} from 'material-expressive-react';
import {Searchbar} from 'material-expressive-react/search';
Props
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
| hintedText | string | search | No | |
| isTrailingAvatar | boolean | true | No | |
| leadingIcon | string | menu | No | |
| onLeadingIconClick | ((event: MouseEvent<HTMLButtonElement, MouseEvent>) => void) | No | ||
| onSearchbarClick | ((event: MouseEvent<HTMLDivElement, MouseEvent>) => void) | No | ||
| onTrailingAvatarClick | ((event: MouseEvent<HTMLButtonElement, MouseEvent>) => void) | No | ||
| onTrailingIconClick | ((event: MouseEvent<HTMLButtonElement, MouseEvent>) => void) | No | ||
| trailingIcon | string | search | No |
Events
This component does not explicitly re-emit DOM events via wrapper props.
Slots
Material Web components frequently use named slots. In React, you can pass slot="..." on children (e.g. <Icon slot="icon" />).
If you need to slot a child component that does not accept a slot prop, use the Slotted utility (see Utilities → Slotted).
Examples
See Storybook for live examples and variants.