Custom label to be used by screen readers. When provided, an aria-label will be added to the element.
string
"a user friendly label for screen readers"
Function that will be called to render the visual representation.
function
It will be passed an object indicating whether the button is checked. It should return a react element.
({ checked }) => <Box>...</Box>
Same as React <input disabled={} />. Also adds a hidden input element with the same name so form submissions work.
boolean
true
false
At its core, the RadioButton component is a regular <input> element. Thus, both DOM and React properties, methods, and events are accessible. To read up on all of the possible DOM attributes and types available for input elements, check out this MDN Web Documents page. To learn more about DOM events and methods, you can read more on the MDN Web Events documentation page.
Also, feel free to read about the types of React events available, or see how DOM attributes change in React. Working in tandem with Styled Components, you also have access to the as property.
The default color of the border surrounding the checked icon in RadioButton checked state.
string
A hex, name, or rgb value.
"brand"
object
An object with a color for dark and light modes.
{ dark: "graph-0", light: "brand" }
The color of the border of the Radio Button.
string
A hex, name, or rgb value.
"brand"
object
An object with a color for dark and light modes.
{ dark: "rgba(255, 255, 255, 0.5)", light: "rgba(0, 0, 0, 0.15)" }
The background color of the RadioButton.
string
A hex, name, or rgb value.
"brand"
object
An object with a color for dark and light modes.
{ dark: "string", light: "string" }
The background color of the RadioButton when checked.
string
A hex, name, or rgb value.
"brand"
object
An object with a color for dark and light modes.
{ dark: "string", light: "string" }
The color of the checked icon in the RadioButton.
string
A hex, name, or rgb value.
"brand"
object
An object with a color for dark and light modes.
{ dark: "string", light: "string" }
Any additional style for the checked RadioButton.
string
Any CSS.
css`color: 'blue'`
function
(props) => {}
The color of the border surrounding the checked icon in RadioButton checked state.
string
A hex, name, or rgb value.
"brand"
object
An object with a color for dark and light modes.
{ dark: "string", light: "string" }
Any additional style for the container around the radio button and its label.
string
Any CSS.
css`color: 'blue'`
function
(props) => {}
Any additional style for the radio button itself.
string
Any CSS.
css`color: 'blue'`
function
(props) => {}
The background color of the Box surrounding the RadioButton when hovered over.
string
A hex, name, or rgb value.
"brand"
object
An object with a color for dark and light modes.
{ dark: "string", light: "string" }
The color of the RadioButton border when hovered over.
string
A hex, name, or rgb value.
"brand"
object
An object with a color for dark and light modes.
{ dark: "white", light: "black" }
Any additional style for the RadioButton icon.
string
Any CSS.
css`color: 'blue'`
function
(props) => {}