Documentation
Feedback
Guides
Storefront Development

Storefront Development
FastStoreUI componentsMolecules
Checkbox Field

Checkbox Field grouped a Checkbox input and its corresponding Label.

Checkbox Field wraps a Checkbox input and its corresponding Label. It allows users to select one option from a set.

Overview

Example
Code

Import

Import the component from @faststore/ui

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

Import Styles into your FastStore project

To apply the styles of this component in your FastStore project, import the following into your stylesheet:

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

Follow the instructions in the Importing FastStore UI component styles tutorial.

Usage


_10
<CheckboxField label="Faststore" id="faststore" />


Props

NameTypeDescriptionDefault
testIdstringID to find this component in testing tools (e.g.: cypress, testing library, and jest).fs-checkbox-field
id*stringID to identify input and corresponding label.
label*stringThe text displayed to identify the input checkbox.
valuestringThe value to identify the input checkbox.
namestringIdentify checkbox in the same group.

Design Tokens

Local tokenDefault value/Global token linked
--fs-checkbox-field-gapvar(--fs-spacing-1)

Customization

For further customization, you can use the following data attributes:
data-fs-checkbox-field
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