UI Components
Molecules
Search Auto Complete

Search Auto Complete

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

Import

Import the component from @faststore/ui

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

Import Styles

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

Usage


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>> | ReactFragment | ReactPortalA React component that will be rendered as an icon.
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


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