گروه رادیو (Radio Group)
کنترل فرم برای انتخاب تک گزینهای
معرفی
کامپوننت RadioGroup برای انتخاب یک گزینه از بین چند گزینه استفاده میشود.
استفاده
import { RadioGroup, RadioGroupItem } from '@parto/ui';
import { Label } from '@parto/ui';
export default function MyComponent() {
return (
<RadioGroup defaultValue="option-one">
<div className="flex items-center gap-2">
<RadioGroupItem value="option-one" id="option-one" />
<Label htmlFor="option-one">گزینه اول</Label>
</div>
<div className="flex items-center gap-2">
<RadioGroupItem value="option-two" id="option-two" />
<Label htmlFor="option-two">گزینه دوم</Label>
</div>
</RadioGroup>
);
}