Radio
Use Radio components to be part of an options list where users can only make a single choice.
Version 0.3.2
Installation
To install @igloo-ui/radio
in your project, you will need to run the following command using npm:
npm install @igloo-ui/radio
If you prefer Yarn, use the following command instead:
yarn add @igloo-ui/radio
Then to use the component in your code just import it!
import Radio from '@igloo-ui/radio';
<Radio htmlFor="radio-id">Label</Radio>;
API
Prop | Type | Default | Description |
---|---|---|---|
children | ReactNode | - | The content to display inside the label |
className | string | - | Add a specific class to the checkbox |
dataTest | string | - | Add a data-test tag for automated tests |
htmlFor | string | - | Indicates the ID of the element that is controlled by the checkbox |
small | boolean | - | Changes the size of label |
checked | boolean | - | Modifies true/false value of the native checkbox |
disabled | boolean | - | Modifies the native disabled state of the native checkbox |
helperText | string | - | The content to display to help users |
onChange | (e: ChangeEvent<HTMLInputElement>) => void | - | Function called when the value changes |