yarn add @twilio-paste/radio-group - or - yarn add @twilio-paste/core
import {Radio, RadioGroup} from '@twilio-paste/core/radio-group';
const Component = () => (
<RadioGroup name="foo" value="foo" legend="foo" onChange={NOOP}>
<Radio id="foo" value="foo" name="foo">
Foo
</Radio>
</RadioGroup>
);
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
hasError
Adds an error state to the Radio Button
- Type
boolean
helpText
Provides additional help text for the Radio Button
- Type
| string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal
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
element
Overrides the default element name to apply unique styles with the Customization Provider
- Type
any
- Default
RADIO_GROUP
i18nRequiredLabel
Label text for the required dot in the legend
- 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.