Home/Components/Checkbox

Checkbox Component

A simple checkbox component for binary selections. Perfect for forms and preference settings with label support.

Form Control

Live Preview

Current value: unchecked

Usage

import { Checkbox } from '@featherstudio/react-daisyui-kit';
import { useState } from 'react';

export default function App() {
  const [checked, setChecked] = useState(false);

  return (
    <Checkbox
      checked={checked}
      onChange={setChecked}
      label="I agree to terms"
    />
  );
}

Features

Simple & Clean

Minimal and straightforward checkbox component.

Label Support

Easily associate labels with checkboxes.

Accessible

Full keyboard navigation and screen reader support.

Customizable

Style it with Tailwind CSS to match your design.

Props

PropTypeDefaultDescription
checkedbooleanfalseChecked state
onChange(checked: boolean) => void-Called with the next checked state
labelstring-Associated label text
disabledbooleanfalseDisable checkbox
idstring-Unique identifier
size'sm' | 'md' | 'lg''md'Controls the DaisyUI checkbox size
errorstring | string[]-Applies the error style for form validation scenarios
onBlur() => void-Blur handler for focus validation flows
Back to Components