Skip to content

DocsFormsCheckbox

PT

Forms

Checkbox

Checked, empty and partial, with a springy check stroke.

data-u="indeterminate"

Example

Installation

Checkbox ships in the full package, in unslop.css and unslop.js:

curl -fsSL unslop.leallabs.dev/i | sh

No build Name-based add is for charts and blocks. Components with JS live in unslop.js, which mounts every data-u on the page by itself.

Classes and variants

ClassWhat it does
u-checkThe label that wraps the input and the box.
u-check__boxThe drawn box. The svg holds the check (u-tick) and the partial dash (u-dash).
data-u="indeterminate"On the label: the checkbox starts partial and cycles through partial, checked and empty. It's a demo.

Accessibility and keyboard

State and roles

WhereAttributeWhat it says
checkednative attributeChecked.
indeterminateinput propertyPartial. Set it in JS: input.indeterminate = true.
aria-checked="mixed"on the input, via indeterminateThe indeterminate registration keeps aria-checked at mixed, true or false.

Keyboard

KeyDoes
Tabfocuses the checkbox
Spacingchecks and unchecks

Type to search. Arrows pick, Enter opens.