Documentation
Feedback
Guides
Storefront Development

Storefront Development
Storefront development
ToggleField

Groups a Toggle input and its corresponding Label.

The ToggleField component wraps a Toggle input and its corresponding Label.
Example
Code
Toggle

Usage

Import the component


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

Import styles

To apply styles, include the following in your stylesheet:

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


Data attributes

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

Props

NameTypeDescriptionDefault
testIdstringID to find this component in testing tools (e.g.: cypress, testing library, and jest).fs-toggle-field
id*stringID to identify input and corresponding label.
label*stringThe text displayed to identify the input.
displayLabelfalse | trueControls whether the label will be displayed or not.true
disabledfalse | trueSpecifies that this input should be disabled.
variant"horizontal" | "vertical"Controls the component's direction.horizontal
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