Skip to content

Radio Group

radio-group-basic.tsx
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"
import { Field, FieldLabel } from "@/components/ui/field"

export function RadioGroupBasic() {
  return (
    <RadioGroup>
      <Field orientation="horizontal">
        <RadioGroupItem id="plan-free" name="plan" value="free" defaultChecked />
        <FieldLabel htmlFor="plan-free">Free</FieldLabel>
      </Field>
      <Field orientation="horizontal">
        <RadioGroupItem id="plan-pro" name="plan" value="pro" />
        <FieldLabel htmlFor="plan-pro">Pro</FieldLabel>
      </Field>
      <Field orientation="horizontal">
        <RadioGroupItem id="plan-enterprise" name="plan" value="enterprise" />
        <FieldLabel htmlFor="plan-enterprise">Enterprise</FieldLabel>
      </Field>
    </RadioGroup>
  )
}