Home > @yext/search-ui-react > SearchBarProps
The props for the SearchBar() component.
Signature:
export interface SearchBarProps
Property | Type | Description |
---|---|---|
customCssClasses? | SearchBarCssClasses | (Optional) CSS classes for customizing the component styling. |
geolocationOptions? | PositionOptions | (Optional) Configuration used when collecting the user's location. Definition: https://w3c.github.io/geolocation-api/#position_options_interface. |
hideRecentSearches? | boolean | (Optional) Hides recent searches if true. |
onSearch? | onSearchFunc | (Optional) A callback which is called when a search is ran. |
onSelectVerticalLink? | (data: { verticalLink: VerticalLink; querySource: QuerySource; }) => void | (Optional) A function which is called when a vertical link is selected. |
placeholder? | string | (Optional) The search bar's placeholder text. |
recentSearchesLimit? | number | (Optional) Limits the number of recent searches shown. |
showVerticalLinks? | boolean | (Optional) Shows vertical links if true, set to false on default. |
verticalKeyToLabel? | (verticalKey: string) => string | (Optional) A function which returns a display label for the given verticalKey. |
visualAutocompleteConfig? | VisualAutocompleteConfig | (Optional) The configuration options for Visual Autocomplete. |