Skip to content

Checkbox

InputMIT
View in Storybook

Accessible checkbox with indeterminate state and label support.

bun add @otfdashkit/ui

Preview

Checkbox
Loading Storybook preview…

Code

import { Checkbox } from '@otfdashkit/ui'

export function Example() {
  return (
    <div className="flex flex-col gap-3">
      <div className="flex items-center gap-2">
        <Checkbox id="terms" />
        <label htmlFor="terms" className="text-sm font-medium">Accept terms and conditions</label>
      </div>
      <div className="flex items-center gap-2 opacity-50">
        <Checkbox id="disabled" disabled />
        <label htmlFor="disabled" className="text-sm font-medium">Disabled</label>
      </div>
      <div className="flex items-center gap-2">
        <Checkbox id="checked" defaultChecked />
        <label htmlFor="checked" className="text-sm font-medium">Already checked</label>
      </div>
    </div>
  )
}

Free with the SDK. This component ships in @otfdashkit/ui under the MIT license.