Radio Group
한 번에 하나만 선택할 수 있는 라디오 버튼 그룹입니다.
부가적인 설명이 들어갑니다.
부가적인 설명이 들어갑니다.
설치
사용법
import { Label } from "@/components/ui/label"
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"<RadioGroup defaultValue="option-one">
<div className="flex items-center gap-3">
<RadioGroupItem value="option-one" id="option-one" />
<Label htmlFor="option-one">Option One</Label>
</div>
<div className="flex items-center gap-3">
<RadioGroupItem value="option-two" id="option-two" />
<Label htmlFor="option-two">Option Two</Label>
</div>
</RadioGroup>구성
다음 조합으로 RadioGroup:
RadioGroup
├── RadioGroupItem
└── RadioGroupItem예제
Description
Radio group items with a description using the Field component.
Standard spacing for most use cases.
More space between elements.
Minimal spacing for dense layouts.
Choice Card
Use FieldLabel to wrap the entire Field for a clickable card-style selection.
Fieldset
Use FieldSet and FieldLegend to group radio items with a label and description.
Disabled
RadioGroupItem에 disabled prop을 사용해 개별 항목을 비활성화합니다.
Invalid
Use aria-invalid on RadioGroupItem and data-invalid on Field to show validation errors.
RTL
RTL 지원을 활성화하려면 RTL 설정 가이드를 참고하세요.
تباعد قياسي لمعظم حالات الاستخدام.
مساحة أكبر بين العناصر.
تباعد أدنى للتخطيطات الكثيفة.
API 참조
Radix UI Radio Group 문서를 참고하세요.