Checkbox renders a styled <input type='checkbox'> that integrates directly with Django forms. Colour and size variants match the daisyUI scale; wire name and value as usual.
Basic Checkbox
<c-lb.checkbox />
With Variants
<div class="flex gap-4 flex-wrap">
<c-lb.checkbox variant="primary" checked />
<c-lb.checkbox variant="secondary" checked />
<c-lb.checkbox variant="accent" checked />
<c-lb.checkbox variant="neutral" checked />
<c-lb.checkbox variant="info" checked />
<c-lb.checkbox variant="success" checked />
<c-lb.checkbox variant="warning" checked />
<c-lb.checkbox variant="error" checked />
</div>
With Sizes
<div class="flex gap-4 flex-wrap items-center">
<c-lb.checkbox size="xs" checked />
<c-lb.checkbox size="sm" checked />
<c-lb.checkbox size="md" checked />
<c-lb.checkbox size="lg" checked />
<c-lb.checkbox size="xl" checked />
</div>
With Labels
<div class="flex flex-col gap-2">
<label class="label">
<c-lb.checkbox />
Remember me
</label>
<label class="label">
<c-lb.checkbox variant="primary" disabled checked />
Accept terms and conditions
</label>
<label class="label">
<c-lb.checkbox variant="success" checked />
Subscribe to newsletter
</label>
</div>
API Reference
c-lb.checkbox
| Property | Type | Default | Required | Description |
|---|---|---|---|---|
| class | string | - | No | Additional CSS classes to apply |
| variant |
primary
secondary
accent
neutral
info
success
warning
error
|
- | No | Color variant of the checkbox |
| size |
xs
sm
md
lg
xl
|
md
|
No | Size of the checkbox |
| validate | boolean |
False
|
No | Enable validation styling |