🚀ReacUI is currently in Beta. We're actively improving it! ❣️
Radio
A radio button component for selecting a single option from a set
Installation
The Radio component is part of the ReacUI library. Install the package to use it in your project.
Import
Import the Radio component into your React component.
Basic Usage
The Radio component provides a styled radio button input.
Radio Group
Group radio buttons together to represent a set of related options.
Radio States
Radio buttons can be in different states such as default, checked, or disabled.
In Forms
Radio buttons are commonly used in forms to allow users to select from predefined options.
API Reference
The following props are available for the Radio component.
| Prop | Type | Default | Description |
|---|---|---|---|
| id | string | - | The id attribute of the radio button |
| name | string | - | The name attribute of the radio button, used to group related options |
| defaultChecked | boolean | false | Whether the radio button is checked by default |
| checked | boolean | - | Controls the checked state of the radio button |
| disabled | boolean | false | Whether the radio button is disabled |
| onChange | function | - | Callback function that is triggered when the radio button state changes |