Radio Group
Is a component that instructs the user to select one option from a list of more than 2 options.
Installation
import { RadioGroup , RadioGroupItem } from "@momo-webplatform/mobase";
Usage
- Use the radios to select only one option from a list or question. If we can not select or select many, we use Checkbox.
- To make the decision as easy as possible for users, there should be less than 5 options in a list. If there are too many options or it is not necessary to display the entire selection, replace it with the Dropdown component.
- Note : Always leave a default option so users can quickly distinguish whether this is a single choice or multiple choice.
API Reference
RadioGroup
component extends Radix Radio Group (opens in a new tab) component and supports all of its props.
RadioGroup
Prop | Type | Default | Required |
defaultValue | string | -- | false |
dir | enumDirection | -- | false |
asChild | enumboolean | -- | false |
name | string | -- | false |
required | enumboolean | -- | false |
disabled | enumboolean | -- | false |
orientation | enumhorizontal | vertical | -- | false |
loop | enumboolean | -- | false |
value | string | -- | false |
onValueChange | (value: string) => void | -- | false |
RadioGroupItem
Prop | Type | Default | Required |
asChild | enumboolean | -- | false |
required | enumboolean | -- | false |
value | string | -- | true |
checked | enumboolean | -- | false |