Basic Usage
Using RadioButtonList
For managing multiple radio buttons, use theRadioButtonList component:
Multiple Selection Mode
Disabled State
Custom Styles
Props
RadioButton Props
Whether the radio button is selected.
Disables the radio button and shows a soft border color.
Unique identifier for the radio button (used as role attribute).
Callback fired when the radio button is clicked.
Content to display next to the radio button.
Custom styles for the container.
RadioButtonList Props
Selection mode:
single: Only one option can be selected at a timemultiple: Multiple options can be selected
Array of radio button options.Each option object:
id(string, required): Unique identifierchildren(ReactNode, required): Content to displayselected(boolean, optional): Initial selected statedisabled(boolean, optional): Whether the option is disabled
Callback fired when selection changes:
- For
type="single": Receives the selected option’s id (string) - For
type="multiple": Receives array of selected option ids (string[])
Features
- Smooth Transitions: All state changes are animated with 0.1s linear transitions
- Visual Feedback: Clear visual distinction between selected and unselected states
- Circular Design: 18px outer circle with 10px inner circle indicator
- Primary Color: Uses primary background color from the theme
- Disabled State: Shows soft border when disabled
- Accessible: Uses semantic HTML and proper role attributes
- Flexible Content: Supports any React content as children
Styling
Circle Dimensions
- Outer Circle: 18px width/height with 50% border radius
- Inner Circle: 10px width/height with 50% border radius
- Spacing: 12px margin right between circle and content
Colors
- Border: 2px solid primary color (or soft color when disabled)
- Inner Circle (Selected): Primary background color
- Inner Circle (Unselected): White background
Container
- Margin: 24px vertical margin
- Cursor: Pointer (changes to default when disabled)
- User Select: None (prevents text selection)