Radio buttons allow one selection from a group of options
import { Radio } from "@nulogy/components";
<Radio id="radio" labelText="Radio button" />
<Radio id="disabled-radio" labelText="Radio button" disabled />
<Radio id="error-radio" labelText="Radio button" error />
<Radio id="checked-radio" labelText="Radio button" defaultChecked="true" />
Name | Type | Default | Description |
---|---|---|---|
id | String | null | A unique ID for this input |
name | String | undefined | Identified that groups inputs together |
defaultChecked | Boolean | false | Makes the field checked by default |
disabled | Boolean | false | Marks the field as disabled and disallows user input |
error | Boolean | false | Marks the field as invalid and turns red |
labelText | String | Required | Label for the input |
onChange | Function | null | |
required | Boolean | false | Makes the field require input before the form will submit |
className | String | undefined | className passed to the wrapper |
checked | boolean | undefined | Whether or not this radio button is the currently selected item in the group |