A large checkbox with a bold tick and a padded label, so the whole row is an easy tap target. Checking gives the box a springy pop while the tick draws. Raise --chk-size to grow it further.
Also known as: how to make a checkbox bigger css, large checkbox css, css enlarge checkbox.
<label class="chk-big-checkbox">
<input type="checkbox">
<span class="chk-big-checkbox-box">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5.5 12.5l4 4L18.5 7.5"/></svg>
</span>
Easy to tap
</label>.chk-big-checkbox {
--c: var(--chk-color, #3b82f6);
font-size: var(--chk-size, 24px);
position: relative;
display: inline-flex;
align-items: center;
gap: 0.6em;
font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
line-height: 1.3;
cursor: pointer;
-webkit-tap-highlight-color: transparent;
gap: 0.75em;
padding: 0.4em 1em 0.4em 0.4em;
border-radius: 0.8em;
font-weight: 500;
transition: background-color 0.2s ease;}
.chk-big-checkbox:hover {
background: color-mix(in srgb, var(--c) 8%, transparent);
}
.chk-big-checkbox input {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
margin: 0;
opacity: 0;
cursor: pointer;
z-index: 1;
}
.chk-big-checkbox-box {
box-sizing: border-box;
display: grid;
place-items: center;
flex: none;
width: 2em;
height: 2em;
border: 0.14em solid color-mix(in srgb, currentColor 38%, transparent);
border-radius: 0.45em;
transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.chk-big-checkbox-box svg {
display: block;
fill: none;
stroke-linecap: round;
stroke-linejoin: round;
width: 1.4em;
height: 1.4em;
stroke: #fff;
stroke-width: 3.4;
stroke-dasharray: 20;
stroke-dashoffset: 20;
transition: stroke-dashoffset 0.15s ease-in;
}
.chk-big-checkbox input:checked + .chk-big-checkbox-box {
background: var(--c);
border-color: var(--c);
animation: chk-big-checkbox-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.chk-big-checkbox input:checked + .chk-big-checkbox-box svg {
stroke-dashoffset: 0;
transition: stroke-dashoffset 0.3s cubic-bezier(0.65, 0, 0.35, 1) 0.1s;
}
.chk-big-checkbox input:active + .chk-big-checkbox-box {
transform: scale(0.9);
}
.chk-big-checkbox input:focus-visible + .chk-big-checkbox-box {
outline: 0.125em solid var(--c);
outline-offset: 0.18em;
}
@keyframes chk-big-checkbox-pop {
0% { transform: scale(0.88); }
100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
.chk-big-checkbox, .chk-big-checkbox *, .chk-big-checkbox::before, .chk-big-checkbox::after, .chk-big-checkbox *::before, .chk-big-checkbox *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}--chk-color on the element or a parent.
Currently previewing #3b82f6.--chk-size. Every other dimension is in
em, so the whole thing scales together. Currently previewing 24px.transition or animation
shorthand. Staggered delays are relative, so they keep their rhythm.