[?] Component size, gzipped: 25kb
Radio
Props
Style Overrides
Theme
e => setValue(e.target.value)
<Radio value="1">One</Radio>
<Radio
value="2"
description="This is a radio description"
>
Two
</Radio>
<Radio value="3">
Three
</Radio>
import * as React from "react";
import { RadioGroup, Radio } from "baseui/radio";
export default () => {
const [value, setValue] = React.useState("2");
return (
<RadioGroup
value={value}
onChange={e => setValue(e.target.value)}
disabled={false}
isError={false}
required={false}
autoFocus={false}
>
<Radio value="1">One</Radio>
<Radio
value="2"
description="This is a radio description"
>
Two
</Radio>
<Radio value="3">Three</Radio>
</RadioGroup>
);
}
Beta
Radios are used when only one choice may be selected in a series of options.
When to use
- When the user should see all available options.
Examples
Stateful (uncontrolled) usage
As with many of our components, there is also an uncontrolled version, StatefulRadioGroup, which manages its own state.
Radio exports
You can import this module like so:
import {StatefulRadioGroup} from 'baseui/radio'
It exports the following components or utility functions:
- StatefulRadioGroup
- StatefulContainer
- RadioGroup
- StyledRoot
- StyledLabel
- StyledInput
- StyledDescription
- StyledRadioMarkInner
- StyledRadioMarkOuter
- StyledRadioGroupRoot
- Radio