Skip to content

Checkbox

checkbox-states.tsx
import { Stack } from "@/components/ui/stack"
import { Field, FieldLabel } from "@/components/ui/field"
import { Checkbox } from "@/components/ui/checkbox"

export function CheckboxStates() {
  return (
    <Stack direction="row" className="items-center gap-6">
      <Field orientation="horizontal">
        <Checkbox id="cbs-1" />
        <FieldLabel htmlFor="cbs-1">Default</FieldLabel>
      </Field>
      <Field orientation="horizontal">
        <Checkbox id="cbs-2" checked />
        <FieldLabel htmlFor="cbs-2">Checked</FieldLabel>
      </Field>
      <Field orientation="horizontal" className="opacity-50">
        <Checkbox id="cbs-3" disabled />
        <FieldLabel htmlFor="cbs-3">Disabled</FieldLabel>
      </Field>
      <Field orientation="horizontal" className="opacity-50">
        <Checkbox id="cbs-4" disabled checked />
        <FieldLabel htmlFor="cbs-4">Disabled checked</FieldLabel>
      </Field>
    </Stack>
  )
}