Skip to content

Checkbox and Radio Styles

Bootstrap 6 .check and .radio inputs in default, inline, disabled and indeterminate states, with size modifiers and a brand color set by CSS variables.

Also known as: custom checkbox radio styles, indeterminate checkbox, custom checkbox sizes, inline radio buttons, tri-state checkbox

Checkbox and Radio Styles live demo

Open in new tab

Bootstrap 6 code (HTML, CSS, JS)

A reference sheet of Bootstrap 6 checkboxes and radios in a clean blue "spec sheet" layout. It shows the default, inline, disabled and indeterminate states, plus a strip with every size modifier. Use it to restyle settings pages, filters and sign-up forms, or as a quick look-up when moving from Bootstrap 5.

How it works

Each input is a plain <input class="check"> or <input class="radio"> next to a <label for>, inside a .form-field wrapper. Bootstrap 6 sees a .check, .radio or .switch child and turns the field into a two-column grid, so no form-check markup is needed.

  • Default: two <fieldset class="crs-set"> groups with a <legend class="crs-legend-label">.
  • Inline: the fields sit in .crs-inline, a wrapping flex row. Bootstrap 6 has no form-check-inline.
  • Disabled: uses the disabled attribute. Bootstrap fades the label automatically. One item adds a .form-field-content column with a .form-text hint.
  • Indeterminate: #crs-tri carries data-crs-tristate="mixed". script.js sets the indeterminate property, which has no HTML attribute. On every change it moves through off, mixed and on. It updates .crs-readout and highlights the matching step in .crs-states with .crs-is-current.
  • Sizes: .crs-sizes shows check-sm, check-lg, radio-sm and radio-lg on a dark band.

The brand color is applied without per-input theme classes. .crs-root sets --bs-control-checked-bg, --bs-control-checked-border-color and --bs-focus-ring.

Customization

  • --crs-brand on .crs-root: one value recolors checked boxes, radios, card borders and code chips.
  • --bs-control-checked-bg inside .crs-sizes: gives the dark size strip its own lighter checked color (#7fa2ff).
  • data-crs-tristate on a checkbox: set off, mixed or on as the starting state. Any checkbox with the attribute gets the cycle.
  • LABELS in script.js: change the text shown in .crs-readout for each state.
  • The @media (min-width: 1100px) rule on .crs-grid: change repeat(4, …) to show fewer columns on wide screens.
  • Add check-lg or radio-sm to any input to resize it. Its label font size follows.

Use cases

  • Settings pages: grouped checkboxes and radios in fieldsets with legends
  • Filter panels: inline options and an indeterminate parent checkbox show partial selections
  • Sign-up forms: disabled options with hint text explain why a choice is unavailable
  • Migration and style guides: a quick reference of default, small and large check and radio sizes

Accessibility

Related options are grouped in <fieldset> with a <legend>. Every input has its own label. The tri-state checkbox is a native input, so screen readers announce the mixed state. It is described by the live .crs-readout. Focus uses a 3 px ring in the brand color. The decorative step chips are aria-hidden. Bootstrap's check transitions are disabled under prefers-reduced-motion.

Bootstrap 6 notes

form-check, form-check-input and form-check-label are replaced by .check / .radio inside .form-field. A theme-* class on a check fills it even when unchecked in 6.0.0-alpha.1. That is why this snippet recolors through --bs-control-checked-bg. Built on Bootstrap 6.0.0-alpha.1. Alpha APIs can still change.

Checkbox and Radio Styles at a glance

Framework
Bootstrap 6
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
Bootstrap 6
Layout
Responsive, works on mobile
Category
Checkboxes & Radios
License
Free for personal and commercial use

Questions about this template

Can I use the Checkbox and Radio Styles code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

Load Bootstrap 6 from a CDN (the links are under Requirements). Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

Add these to your page (already included in the download):

  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@6.0.0-alpha.1/dist/css/bootstrap.min.css">
  • <script type="module" src="https://cdn.jsdelivr.net/npm/bootstrap@6.0.0-alpha.1/dist/js/bootstrap.bundle.min.js"></script>

Built for Bootstrap 6.0.0-alpha.1. Bootstrap 6 ships as an ES module, so its script and this component's JavaScript load with type="module". Alpha releases can still change before the stable version.

Checkbox and Radio Styles – Bootstrap 6 checkboxes & radios component screenshot
Checkbox and Radio Styles · Bootstrap 6 Checkboxes & Radios

More Checkboxes & Radios

Checkbox List with Select All – Bootstrap 6 checkboxes & radios preview

Checkbox List with Select All

Bootstrap 6 member list with a select-all checkbox that turns indeterminate, a live counter, Shift+click ranges and bulk action buttons.

Radio Button Cards – Bootstrap 6 checkboxes & radios preview

Radio Button Cards

Bootstrap 6 radio inputs styled as selectable plan and shipping cards with .form-field-card, a live price summary and a simulated submit.

Custom Checkboxes and Switches – Bootstrap 5 checkboxes & radios preview

Custom Checkboxes and Switches

Restyled Bootstrap 5 checkboxes, large switches, select-all with indeterminate state, radio cards and colored checkbox chips.

Radio Card Selector – Tailwind CSS checkboxes & radios preview

Radio Card Selector

Tailwind CSS plan picker that turns native radio inputs into selectable pricing cards with a check indicator, focus ring and live summary.