Checkbox & Radio Generator
Create styled checkbox and radio button components
Input Type
Presets
Content
Sizing
Unchecked Colors
Checked Colors
Other Colors
Border
Effects
Live Preview
All States
Generated CSS
/* Custom Checkbox Styles */
.custom-checkbox {
display: inline-flex;
align-items: center;
gap: 10px;
cursor: pointer;
user-select: none;
font-size: 16px;
color: #374151;
}
.custom-checkbox input {
position: absolute;
opacity: 0;
cursor: pointer;
height: 0;
width: 0;
}
.custom-checkbox .checkbox-box {
position: relative;
display: inline-flex;
align-items: center;
justify-content: center;
width: 20px;
height: 20px;
background: #ffffff;
border: 2px solid #d1d5db;
border-radius: 4px;
transition: all 0.2s ease;
flex-shrink: 0;
}
/* Hover State */
.custom-checkbox:hover .checkbox-box {
background: #eff6ff;
}
/* Focus State */
.custom-checkbox input:focus-visible + .checkbox-box {
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}
/* Checked State */
.custom-checkbox input:checked + .checkbox-box {
background: #3b82f6;
border-color: #3b82f6;
}
/* Checkmark/Dot */
.custom-checkbox .checkbox-box::after {
content: '';
position: absolute;
width: 6px;
height: 11px;
border: solid #ffffff;
border-width: 0 2px 2px 0;
transform: rotate(45deg) scale(0);
transform-origin: center;
margin-top: -2px;
transition: transform 0.2s ease;
}
.custom-checkbox input:checked + .checkbox-box::after {
transform: rotate(45deg) scale(1);
}
/* Disabled State */
.custom-checkbox input:disabled + .checkbox-box {
opacity: 0.5;
cursor: not-allowed;
}
.custom-checkbox:has(input:disabled) {
cursor: not-allowed;
opacity: 0.7;
}HTML Usage
<label class="custom-checkbox"> <input type="checkbox" name="options" /> <span class="checkbox-box"></span> Accept terms and conditions </label>
About Custom Checkboxes & Radio Buttons
Accessibility
Custom checkboxes and radio buttons hide the native input visually but keep it accessible to screen readers. The :focus-visible state ensures keyboard users can see focus indicators.
Checkbox vs Radio
Use checkboxes for multiple selections (any number of options can be selected). Use radio buttons for single selection from a group (only one option can be selected).
Label Association
Wrapping the input in a <label> element allows clicking anywhere on the label to toggle the input, improving usability and touch targets.
Browser Support
This technique works in all modern browsers. The :has() selector for disabled states has wide support (95%+). For older browsers, add separate disabled classes.
Need Custom Form Components?
Our team at Brix340 designs beautiful, accessible form interfaces that match your brand and convert visitors into customers.
Get a Free Consultation