Custom Checkbox & Radio Button Styler

Preview

Focus state will show a #93c5fd outline around the input
.custom-checkbox-container {
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  user-select: none;
}

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

.custom-checkbox-checkmark {
  position: relative;
  height: 20px;
  width: 20px;
  background-color: #ffffff;
  border: 2px solid #d1d5db;
  border-radius: 4px;
  transition: all 200ms ease;
}

.custom-checkbox-container:hover input ~ .custom-checkbox-checkmark {
  background-color: #ffffff;
}

.custom-checkbox-container input:checked ~ .custom-checkbox-checkmark {
  background-color: #3b82f6;
  border-color: #3b82f6;
  transform: scale(1);
}

.custom-checkbox-checkmark:after {
  content: "";
  position: absolute;
  display: none;
  transition: all 200ms ease;
}

.custom-checkbox-container input:checked ~ .custom-checkbox-checkmark:after {
  display: block;
  animation: checkmark-scale 0.2s ease-in-out;
  
}

/* Checkmark/Indicator */
.custom-checkbox-container .custom-checkbox-checkmark:after {
  left: 3px;
  top: 1px;
  width: 6px;
  height: 12px;
  border: solid #ffffff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.custom-checkbox-container input:focus ~ .custom-checkbox-checkmark {
  box-shadow: 0 0 0 3px #93c5fd;
  outline: none;
}

.custom-checkbox-container input:disabled ~ .custom-checkbox-checkmark {
  background-color: #e5e7eb;
  border-color: #d1d5db;
  cursor: not-allowed;
}

.custom-checkbox-container input:disabled ~ .custom-checkbox-checkmark:after {
  border-color: #9ca3af;
  background-color: #9ca3af;
}

.custom-checkbox-container input:disabled {
  cursor: not-allowed;
}

.custom-checkbox-container:hover input:disabled ~ .custom-checkbox-checkmark {
  background-color: #e5e7eb;
  border-color: #d1d5db;
}

/* Animations */
@keyframes checkmark-scale {
  0% {
    transform: scale(0);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes checkmark-fade {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Label Styling */
.custom-checkbox-label {
  margin-left: 8px;
  font-size: 14px;
  cursor: pointer;
}

Input Type

Size & Shape

Colors

Checkmark & Animation

States & Accessibility

Related Tools

Custom Checkbox & Radio Button Styler: Your Complete Solution

Easily customize the look and feel of checkboxes and radio buttons to match your website’s design. This tool helps you create stylish, accessible form controls with CSS.

Why is it Useful?

Default checkboxes and radio buttons often look plain and inconsistent across browsers. Custom styling:

  • Enhances UI aesthetics and user experience
  • Keeps your design consistent across platforms
  • Improves form accessibility and usability
  • Allows branding with custom colors, shapes, and animations
  • Increases engagement with visually appealing controls

Key Features

  • Custom colors, sizes, and shapes for checkboxes and radio buttons
  • Support for animations and transitions on interaction
  • Accessible and keyboard-friendly controls
  • Generates CSS code for easy integration
  • Live preview of styled controls

How to Use?

  1. Select whether you want to style checkboxes or radio buttons
  2. Customize colors, sizes, border radius, and animations
  3. See live preview of your styles
  4. Copy the generated CSS code
  5. Paste the CSS into your project to apply the styles

Use Cases

This tool is useful for:

  • Web Developers and Designers: Customize forms for better branding
  • UX/UI Designers: Enhance user interface consistency
  • Accessibility Experts: Ensure controls remain accessible
  • Students and Learners: Practice CSS styling techniques
  • Anyone: Looking to improve form aesthetics

Benefits

  • Improves visual appeal of forms with easy customization
  • Enhances brand identity through consistent styling
  • Maintains accessibility standards while styling
  • Speeds up development with generated code
  • Responsive and works on all modern browsers

Frequently Asked Questions

Will these styles work on all browsers?

Yes, the generated CSS is compatible with all modern browsers.

Are the custom controls accessible?

Yes, the controls maintain keyboard navigation and screen reader support.

Can I animate checkboxes and radio buttons?

Yes, you can add transitions and animations to enhance interactivity.

Is the CSS easy to integrate?

Absolutely, you can copy and paste the generated CSS into your project.

Is this tool free to use?

Yes, it is completely free with no sign-up required.