RadioButtonGroup
Note: The example below won't work due to a quirk in the docs.
Source codeimport { RadioButtonGroup,RadioButtonGroupItem } from "rfui";
Basic
<RadioButtonGroup name="plan">
<RadioButtonGroupItem value="free">
Free
</RadioButtonGroupItem>
<RadioButtonGroupItem value="basic">
Basic
</RadioButtonGroupItem>
<RadioButtonGroupItem value="premium">
Premium
</RadioButtonGroupItem>
</RadioButtonGroup>
Controlled
<RadioButtonGroup
name="plan"
selectedValue={selectedValue}
onChange={(newSelectedValue) => {
setSelectedValue(newSelectedValue);
}}
>
<RadioButtonGroupItem value="free">
Free
</RadioButtonGroupItem>
<RadioButtonGroupItem value="basic">
Basic
</RadioButtonGroupItem>
<RadioButtonGroupItem value="premium">
Premium
</RadioButtonGroupItem>
</RadioButtonGroup>
Props
Prop | Required | Default | Type and notes |
---|---|---|---|
name | - | - |
This will be passed to the <input type="radio" /> in RadioButtonGroupItem . |
selectedValue | - | - |
|
onChange | - | - |
|
children | ✔ | - |
|
RadioButtonGroupItem
Prop | Required | Default | Type and notes |
---|---|---|---|
value | - | - |
|
radioButtonRest | - | - |
This gets spread to the RadioButton like so:
|
children | ✔ | - |
|
...rest | - | - |
|