Documentation
Feedback
Guides
Storefront Development

Storefront Development
Storefront development
SelectField

Groups a Select input and its corresponding Label.

The SelectField component wraps a Select input and its corresponding Label. It allows users to select one option from a set.
Example
Code

Usage

Import the component


_10
import { SelectField } from '@faststore/ui'

Import styles

To apply styles, include the following in your stylesheet:

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


Design tokens

Local tokenDefault value/Global token linked
--fs-select-label-color
var(--fs-color-text-light)
--fs-select-label-margin-rightvar(--fs-spacing-1)

Data attributes

You can target and override SelectField styles using the following data attributes:
data-fs-select-field
data-fs-select-field-label

Props

NameTypeDescriptionDefault
label*stringDefines the text displayed in the label right next to the Select.
testIdstringID to find this component in testing tools (e.g.: cypress, testing library, and jest).fs-select-field
id*stringAssigns an identifier to link the UISelect component and its label.
options*Record<string, string>Defines the options available in the select. The SelectOptions object keys are the property names, while the values correspond to the text that will be displayed in the UI.
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