A collection of four animated checkbox styles built with pure CSS and no JavaScript: a filled square, a bouncing circle, a task item that crosses itself out and a hand-drawn sketch check. Each check mark is an SVG path that draws itself when the box is ticked. Use them in settings pages, filters, to-do lists, sign-up forms and consent checkboxes.
How it works
The root section.ack-gallery holds an .ack-grid of four fieldset.ack-set cards, each with a legend.ack-legend and three label.ack-item rows. Inside each label is the real input.ack-input (visually hidden but still focusable), an .ack-box that draws the box, and the .ack-text. The box contains an inline SVG .ack-icon with one path that has pathLength="1", so stroke-dasharray: 1 and stroke-dashoffset: 1 hide it regardless of its real length. The :checked + .ack-box selector sets the offset to 0, and the transition draws the stroke. The path is also hidden with opacity while unchecked so the round line cap never leaves a dot.
Each modifier class adds its own touch. .ack-set--draw fills the square with the accent color before the white check appears. .ack-set--pop makes the box round, runs the ack-pop bounce and sends out a fading ack-ring pulse from ::after. .ack-set--strike draws an accent-colored check and then a line across the .ack-text via a scaled ::after. .ack-set--sketch uses a longer, curved path that overshoots the box like a pen stroke. Disabled inputs are dimmed with a not-allowed cursor.
Customization
--ack-draw,--ack-pop,--ack-strikeand--ack-sketchon.ack-gallery: the accent color of each style, shown on the card's top border, fills and strokes.--ack-size: the size of every box; the check mark scales with it.--ack-speed: the base animation duration;0.6sgives a slower, more noticeable draw.--ack-focus: the focus ring color around the box.- Copy one
label.ack-iteminto any form and wrap it in an element with the matching.ack-set--*class to reuse a style on its own. grid-template-columnsin the.ack-gridmedia queries: one column on phones, two from 600 px and four from 1000 px.
Use cases
- Task and to-do apps: a strike-through checkbox style crosses out finished items
- Settings and preference forms: four styles show filled square, bouncing circle and sketch checks
- Sign-up forms: animated check marks make terms and newsletter boxes feel polished
- Playful interfaces: self-drawing SVG ticks add motion without any JavaScript
Accessibility
Every checkbox is a native input type="checkbox" inside its label, so clicking the text toggles it, the Space key works, and forms submit the name and value as usual. Each group is a fieldset with a legend, so screen readers announce the group name. The decorative .ack-box is aria-hidden. Keyboard focus shows a 3 px outline around the box via :focus-visible. With prefers-reduced-motion: reduce, --ack-speed drops to almost zero and the bounce and pulse animations are removed, so states change instantly.
Usage notes
The styles rely only on sibling selectors; :has() is used just for the disabled cursor and the color-mix() tint in the strike style needs a current browser.