Docs
Radio-group

Radio Group

Used to select a single state from multiple options.

Default

Light

Dark

Usage

Example Code

1import { RadioGroup, RadioGroupItem } from "inc-design-system/radioGroup";

Example Code

1<RadioGroup defaultValue="light">
2  <div className="flex items-center space-x-2">
3    <RadioGroupItem value="light" id="r2" />
4    <h1>Light</h1>
5  </div>
6  <div className="flex items-center space-x-2">
7    <RadioGroupItem value="dark" id="r3" />
8    <h1>Dark</h1>
9  </div>
10</RadioGroup>

Props

RadioGroup

PropTypeDescriptionDefault
asChildbooleanRender the radio group as a child component. Default is false.false
defaultValuestringThe default value of the radio group. No default value.-
valuestringThe value of the radio group. No default value.-
onValueChange(value: string) => voidCallback when the value of the radio group changes. No default value.-
disabledbooleanWhether the radio group is disabled. No default value.-
namestringThe name attribute of the radio group. No default value.-
requiredbooleanWhether the radio group is required for form submission. No default value.-
orientationenumThe orientation of the radio group.undefined
direnumThe direction of the radio group. No default value.-
loopbooleanWhether the radio group should loop focus. Default is true.true

RadioGroupItem

PropTypeDescriptionDefault
asChildbooleanRender the radio group item as a child component. Default is false.false
valuestringThe value of the radio group item. No default value.-
disabledbooleanWhether the radio group item is disabled. No default value.-
requiredbooleanWhether the radio group item is required. No default value.-