Home/Tools/Components/Checkbox & Radio Generator
Components · Generator

Checkbox & Radio Generator

Customize checkboxes and radio buttons with unique styles and animations.

Input Settings

16px
Preview:

Preview

Generated CSS & HTML
.custom-checkbox {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 16px;
}

.custom-checkbox input {
  opacity: 0;
  position: absolute;
  width: 0;
  height: 0;
}

.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 16px;
  width: 16px;
  background-color: #fff;
  border: 2px solid #d1d5db;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.custom-checkbox:hover input ~ .checkmark {
  border-color: #0071e3;
}

.custom-checkbox input:checked ~ .checkmark {
  background-color: #0071e3;
  border-color: #0071e3;
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
  left: 4.8px;
  top: 1.6px;
  width: 4.8px;
  height: 9.6px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.custom-checkbox input:checked ~ .checkmark:after {
  display: block;
}
100%
Free, no
sign-up needed
0
Code written
by hand
85+
CSS tools
in one place
<1s
Copy-ready
CSS instantly
What is this

What is the CSS Checkbox & Radio Generator?

Style custom checkboxes and radio buttons with pure CSS. Accessible, keyboard-operable, and works in all modern browsers.

Everything runs locally in your browser. Adjust the controls above, preview instantly, and copy clean, production-ready CSS — no account, no upload.

How to use

Using the CSS Checkbox & Radio Generator

Everything lives in the panel at the top of this page. There is nothing to install — it all runs right here in your browser.

1

Choose checkbox or radio

Toggle between checkbox (multiple selection) and radio (single selection). The shape changes to square vs circle accordingly.

2

Set size and colours

Adjust the control size (14px-24px) and the checked state colour.

3

Copy the CSS

Click Copy. The generated CSS uses appearance: none to override browser defaults. Tested in Chrome 84+, Firefox 80+, Safari 15+.

The output

What the generated code looks like

Clean, production-ready CSS — no vendor bloat, no unnecessary declarations.

checkbox.css
.custom-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.custom-checkbox input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.custom-checkbox input[type="checkbox"]:checked {
  background: #0071e3;
  border-color: #0071e3;
  background-image: url("data:image/svg+xml,...");
  background-repeat: no-repeat;
  background-position: center;
}

.custom-checkbox input[type="checkbox"]:focus-visible {
  outline: 2px solid #0071e3;
  outline-offset: 2px;
}

appearance: none removes the browser default checkbox rendering. The :checked state uses an SVG data URI for the checkmark. This is the modern approach supported in all browsers since Chrome 84, Firefox 80, Safari 15.

Common mistakes & fixes

Common mistakes & how to fix them

A few habits trip people up. Here is what to watch for — and the exact fix.

Using appearance:none without a fallback

In very old browsers (IE11), appearance: none may not work, leaving unstyled inputs.

Fix: Wrap custom styles in @supports (appearance: none) if IE11 support is required. For modern browsers, appearance: none has near-universal support.

Pro tips

Pro tips for better results

Use the :indeterminate state for multi-select "select all" patterns

Checkboxes have a third state: indeterminate. Set it with JS: el.indeterminate = true. Style it with input:indeterminate for a dash indicator in parent checkboxes.

FAQ

Frequently asked questions

Yes. The underlying input element is still present and submitted with the form. Only the visual appearance is changed by CSS.
Use the :disabled state combined with the adjacent sibling combinator: input:disabled + span { color: #999; cursor: not-allowed; }

From the blog

Read more