Task path / input to outcome
How to design a custom CSS checkbox
- 01
Set the control size
The mark scales from the space inside the border, rather than the outer size. Preview and export use the same CSS border shape. Click the preview or focus it and press Space to switch its native checked state.
- 02
Shape the frame
Use an 18–64 px control and a 1–8 px border. At least 8 px must remain inside the border for the mark. Invalid combinations clear the preview and disable export.
- 03
Pick the state colors
Choose Border color for the resting outline and Checked color for the filled state. Keep the Checked color dark enough to contrast with the white mark it sits behind, because the mark itself is always white.
- 04
Preview both states
Flip Show checked state to compare the resting and filled sides in the live preview. The mark transitions in over 160 ms with a small scale-up — exactly the motion the exported CSS reproduces between states.
- 05
Copy or download the CSS
Press Copy CSS or Download .css to save toolars-checkbox.css. The ruleset keeps a real input underneath — appearance: none only repaints it — and :focus-visible plus :disabled states come included in the export.
- 06
Keep the markup native
Apply the .checkbox class directly to a real input element and pair it with a label as you would for any checkbox. Keyboard focus, click behavior, and assistive-technology announcements keep working because nothing semantic is replaced. The resting white background is part of the rule, so the empty state stays readable on tinted surfaces.