yarn add @twilio-paste/radio-button-group - or - yarn add @twilio-paste/core
import {RadioButtonGroup, RadioButton} from '@twilio-paste/core/radio-button-group';
const Component = () => (
<RadioButtonGroup attached>
<RadioButton>One</RadioButton>
<RadioButton>Two</RadioButton>
<RadioButton>Three</RadioButton>
</RadioButtonGroup>
);
checked
Sets the Radio Button as checked
- Type
boolean
defaultChecked
Sets the Radio Button as the default checked option
- Type
boolean
disabled
Make the Radio Button disabled
- Type
boolean
element
Overrides the default element name to apply unique styles with the Customization Provider.
- Type
any
- Default
RADIO_BUTTON
hasError
Adds an error state to the Radio Button
- Type
boolean
id
ID for the Radio Button
- Type
string
name
Name for the Radio Button Group
- Type
string
value
Value for the Radio Button
- Type
string
Inherited props
Paste components will often extend native HTML elements and as a result will inherit or extend their available properties. Below is a list of the props this component has inherited and are also available to use.
name RequiredRequired
Name for the Radio Button Group
- Type
string
attached
If the group of buttons are visually attached
- Type
boolean
element
Overrides the default element name to apply unique styles with the Customization Provider.
- Type
any
- Default
RADIO_BUTTON_GROUP
i18nRequiredLabel
Overrides the default string marking the group as required
- Type
string
- Default
(required)
onChange
Pass a function for the onChange handler
- Type
(value: string) => void
value
Value for the Radio Button Group
- Type
string
Inherited props
Paste components will often extend native HTML elements and as a result will inherit or extend their available properties. Below is a list of the props this component has inherited and are also available to use.