An Indigo-themed, stateful checkbox component. Supports checked, indeterminate, disabled, and error states with high-fidelity focus indicators.
The outer flex container that maintains alignment between the box and label.
The Indigo-primary surface that indicates checked and indeterminate states.
Interactive text label that also triggers the checkbox state on click.
// ExperimentCheckbox.tsx
const ExperimentCheckbox = ({ checked, label, onChange }) => (
<label className="flex items-center gap-3 cursor-pointer">
<input type="checkbox" className="sr-only" checked={checked} onChange={onChange} />
<div className="w-4.5 h-4.5 bg-indigo-600 rounded-md flex items-center justify-center transition-all">
{checked && <CheckIcon className="w-3 h-3 text-white" />}
</div>
<span className="text-sm font-medium">{label}</span>
</label>
);