Next to the properties listed in the propstable, a collection of system props can be added to any component for further general styling and layouting purposes. These props vary per component.
To meet accessibility requirements, every Radio should have an associated label.
We do support the ability to visually hide the label when the Radio's purpose is
clear.
<Radio
name="labeHidden"
id="labelHidden"
value="hi"
label="Label is still required"
labelHidden
/>
LabelPlacement
default: undefined
The positioning of the label against the Radio itself. The full label will move
position (also action, message & optionalLabel).
You can visually change the label of the Radio. For more info about the
possibilities, check the Text component's
documentation (Label inherits the Text).
<Radio
mb={5}
name="labelProps"
id="labelProps"
label="Label"
labelPlacement="left"
labelProps={{
color:'primaryBase',
decoration:'line-through',
fontFamily:'primary',
fontWeight:'regular',
size:'Heading2',
textTransform:'capitalize',
}}
/>
Message
default: undefined
Give additional information to the user.
<Radio
name="message"
id="message"
value="message"
label="Label"
message="Message can be set to provide additional information."
/>
OptionalLabel
default: undefined
If the optionalLabel is not set, the Radio is required.
<Radio
name="optionalLabel"
id="optionalLabel"
value="optionalLabel"
label="Label"
optionalLabel="I'm optional"
/>
Required
default: true
By default the Radio is required. You can change this by providing an
optionalLabel or passing false to the required prop. We encourage you to use the
optionalLabel prop, this provides additional feedback to the user!