Documentation
Feedback
Guides
Storefront Development

Storefront Development
Storefront development
SearchInputField

Responsible to receive, search and display suggestions.

An InputField with a search button. This component is part of the Search feature.
Example
Code

Usage

Import the component


_10
import { SearchInputField } from "@faststore/ui";

Import styles

To apply styles, include the following in your stylesheet:

_10
@import "@faststore/ui/src/components/molecules/SearchInputField/styles.scss";


Design tokens

Local tokenDefault value/Global token linked
--fs-search-input-field-height-mobilevar(--fs-control-tap-size)
--fs-search-input-field-height-desktopvar(--fs-spacing-6)
--fs-search-input-field-transition-timingvar(--fs-transition-timing)
--fs-search-input-field-transition-functionease

Design tokens: Button

Local tokenDefault value/Global token linked
--fs-search-input-field-button-min-heightvar(--fs-search-input-height-desktop)
--fs-search-input-field-button-padding-top-desktopvar(--fs-spacing-0)
--fs-search-input-field-button-padding-bottom-desktopvar(--fs-search-input-field-button-padding-top-desktop)

Design tokens: Input

Local tokenDefault value/Global token linked
--fs-search-input-field-input-padding-rightvar(--fs-search-input-field-button-width)
--fs-search-input-field-input-bkg-color
var(--fs-color-body-bkg)

Data attributes

You can target and override SearchInputField styles using the following data attributes:
data-fs-search-input-field
data-fs-search-input-field-input

Props

NameTypeDescriptionDefault
testIdstringID to find this component in testing tools (e.g.: cypress, testing library, and jest).fs-search-input
buttonPropsButtonPropsProps for the submit button inside the input.
buttonIconstring | number | false | true | {} | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortalA React component that will be rendered as an icon (submit button).<Icon name="MagnifyingGlass" />
aria-labelstringCustom aria-label for input and button.
onSubmit*(value: string) => voidCallback function when submitted.
Contributors
3
Photo of the contributor
Photo of the contributor
Photo of the contributor
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
3
Photo of the contributor
Photo of the contributor
Photo of the contributor
On this page