Components
Loading preview...
A control that allows the user to toggle between checked and not checked.
npx shadcn@latest add https://21st.dev/r/sean0205/checkbox-1'use client';
import { useId, useState } from 'react';
import { Checkbox } from '@/components/ui/checkbox-1';
import { Label } from '@/components/ui/label';
export default function CheckboxDemo() {
const id = useId();
const [checked, setChecked] = useState<'indeterminate' | boolean>('indeterminate');
return (
<div className="flex items-center space-x-2">
<Checkbox id={id} checked={checked} onCheckedChange={setChecked} />
<Label htmlFor={id}>Indeterminate state</Label>
</div>
);
}