Documentation
Feedback
Guides
Storefront Development

Storefront Development
Search Auto Complete

List of auto completing suggestions based on searched term.

List of auto completing suggestions based on searched term. This component is part of the Search feature.

Import

Import the component from @faststore/ui

_10
import { SearchAutoComplete, SearchAutoCompleteTerm } from '@faststore/ui'

Import Styles

_10
import '@faststore/ui/src/components/molecules/SearchAutoComplete/styles.scss'


Usage

Example
Code
Searching for: Appl
  1. apple airpods

  2. apple tv


Props

Search Auto Complete

NameTypeDescriptionDefault
testIdstringID to find this component in testing tools (e.g.: cypress, testing library, and jest).fs-search-auto-complete

Search Auto Complete Term

NameTypeDescriptionDefault
testIdstringID to find this component in testing tools (e.g.: cypress, testing library, and jest).fs-search-auto-complete-term
linkPropsPartial<LinkProps<LinkElementType>>Props for the link from term component.
iconstring | number | false | true | {} | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortalA React component that will be rendered as an icon.<Icon name="MagnifyingGlass" width={18} height={18} />
term*stringTerm researched.
suggestion*stringSuggestion proposed with auto complete.

Design Tokens

Local tokenDefault value/Global token linked
--fs-search-auto-complete-padding-topvar(--fs-spacing-2)
--fs-search-auto-complete-padding-rightvar(--fs-spacing-3)
--fs-search-auto-complete-padding-bottomvar(--fs-search-auto-complete-padding-top)
--fs-search-auto-complete-padding-leftvar(--fs-search-auto-complete-padding-right)
--fs-search-auto-complete-transition-propertyvar(--fs-transition-property)
--fs-search-auto-complete-transition-functionvar(--fs-transition-function)
--fs-search-auto-complete-transition-timingvar(--fs-transition-timing)

Nested Elements

Item

Local tokenDefault value/Global token linked
--fs-search-auto-complete-item-column-gapvar(--fs-spacing-1)
--fs-search-auto-complete-item-text-sizevar(--fs-text-size-2)
--fs-search-auto-complete-item-line-height1.25
--fs-search-auto-complete-item-bkg-color-hover
var(--fs-color-tertiary-bkg-hover)

Icon

Local tokenDefault value/Global token linked
--fs-search-auto-complete-item-icon-color
var(--fs-color-neutral-4)
--fs-search-auto-complete-item-icon-size1.125rem

Variants

Other Icons

Example
Code

Customization

For further customization, you can use the following data attributes:
data-fs-search-auto-complete
data-fs-search-auto-complete-item
data-fs-search-auto-complete-item-link
data-fs-search-auto-complete-item-icon
Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
Was this helpful?
Yes
No
Suggest edits (Github)
Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
On this page