RadioGroup
Allows users to select a single option from a list of two or more mutually exclusive options.
The
RadioGroup allows users to select a single option from a list of two or more mutually exclusive options.Example
Code
Usage
Import the component
_10import { RadioGroup, RadioField } from '@faststore/ui'
Import styles
To apply styles, include the following in your stylesheet:
_10@import '@faststore/ui/src/components/atoms/Radio/styles.scss'
_10@import '@faststore/ui/src/components/molecules/RadioField/styles.scss'
For details, see Importing FastStore UI component styles.
Data attributes
You can target and override
RadioGroup styles using the following data attributes:data-fs-radio-group-optionProps
| Name | Type | Description | Default |
|---|---|---|---|
| name* | string | Name to link children by context. | |
| selectedValue | string | number | Value of checked child. | |
| onChange | ChangeEventHandler<HTMLInputElement> | Function that is triggered when any children is checked. |