Documentation Upgrade
Start here
CwCheckbox is the library checkbox for independent yes or no selections. Use one checkbox per independent option, and rely on `name`, `value`, and `checked` when the control needs to participate in native form submission.
Copy-paste examples
These snippets intentionally show the full public API surface the live demo relies on.
Bound checkbox field
This is the normal pattern for filters, export toggles, and settings forms.
<script lang="ts">
let includeOffline = $state(true);
</script>
<CwCheckbox
name="includeOffline"
label="Include offline devices"
description="Keep stale or disconnected devices in the table."
bind:checked={includeOffline}
/>
Immediate side effects on selection
Use callbacks when checking the box should trigger follow-up work immediately.
<CwCheckbox
name="emailDigest"
label="Email digest"
oninput={(checked) => console.log('input', checked)}
onchange={(checked) => savePreference('emailDigest', checked)}
/>