<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/a-decent-custom-checkbox-pattern-for-until-checkmark-is-ready-j4bey2vsd" -->

---
title: A decent custom checkbox pattern for until ::checkmark...
description: A practical CSS/HTML pattern for building custom-styled checkboxes today, while waiting for the upcoming ::checkmark pseudo-element and appearance: base to...
canonical: https://daily.dev/posts/a-decent-custom-checkbox-pattern-for-until-checkmark-is-ready-j4bey2vsd
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: A decent custom checkbox pattern for until ::checkmark is ready | daily.dev
og:description: A practical CSS/HTML pattern for building custom-styled checkboxes today, while waiting for the upcoming ::checkmark pseudo-element and appearance: base to...
og:url: https://daily.dev/posts/a-decent-custom-checkbox-pattern-for-until-checkmark-is-ready-j4bey2vsd
og:image: https://api.daily.dev/og/posts/j4bey2VSd.png
og:image:alt: A decent custom checkbox pattern for until ::checkmark is ready
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# A decent custom checkbox pattern for until ::checkmark is ready

**[Piccalilli](https://daily.dev/sources/piccalilli)** · 6 min read · 9 upvotes · 0 comments

## Summary

A practical CSS/HTML pattern for building custom-styled checkboxes today, while waiting for the upcoming ::checkmark pseudo-element and appearance: base to become browser-supported. The approach layers an accessible, focusable native input with appearance: none and absolute positioning inside a styled box, using :has() and sibling selectors to show/hide an SVG checkmark on the checked state. The pattern uses em units so the component scales with font-size, and also works for radio buttons with a swapped icon.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://piccalil.li/blog/a-decent-custom-checkbox-for-until-checkmark-is-ready>

## Questions this post answers

### How do I style a custom checkbox with CSS while keeping it accessible and focusable?

Keep the native input in the DOM but visually hide it with appearance: none and absolute positioning inside a relatively positioned box, so it remains focusable and shows a focus ring. Use :has(input:checked) on the box to change its background, and a sibling selector like input:checked + svg to reveal an SVG checkmark, all sized with em units so the component scales with font-size.

_Developers building accessible custom form controls can find implementation patterns like this one on daily.dev._

### What CSS feature will eventually let me style checkbox checkmarks natively without hacks?

The ::checkmark pseudo-element, defined in the CSS Forms spec, represents the checked indicator on checkboxes, radios, and option elements, and paired with appearance: base it would let developers set a custom checkmark image directly via CSS content. No browser is currently working on implementing it, so developers still need workaround patterns using hidden native inputs and SVG icons.

_Track emerging CSS capabilities like this one on daily.dev before rebuilding form styling workarounds._

## Similar posts on daily.dev

- [The Radio State Machine](https://daily.dev/posts/the-radio-state-machine-ipavqpxkb) · CSS-Tricks · 3 upvotes · 0 comments
- [Practical CSS: Combining :has, :not, :only-child and :placeholder-shown pseudo-classes](https://daily.dev/posts/practical-css-combining-has-not-only-child-and-placeholder-shown-pseudo-classes-5gvvbff0w) · RUBYLAND · 7 upvotes · 0 comments
- [Chris’ Corner: Click Something Do Something](https://daily.dev/posts/chris-corner-click-something-do-something-o3v7iteuf) · CodePen · 1 upvotes · 0 comments

---

Tags: [#css](https://daily.dev/tags/css), [#html](https://daily.dev/tags/html), [#accessibility](https://daily.dev/tags/accessibility)

[View this post on daily.dev](https://daily.dev/posts/a-decent-custom-checkbox-pattern-for-until-checkmark-is-ready-j4bey2vsd)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"A decent custom checkbox pattern for until ::checkmark is ready","url":"https://daily.dev/posts/a-decent-custom-checkbox-pattern-for-until-checkmark-is-ready-j4bey2vsd","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/a-decent-custom-checkbox-pattern-for-until-checkmark-is-ready-j4bey2vsd"},"datePublished":"2026-09-17T12:07:30.152Z","dateModified":"2026-09-17T12:07:53.613Z","description":"A practical CSS/HTML pattern for building custom-styled checkboxes today, while waiting for the upcoming ::checkmark pseudo-element and appearance: base to...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/99317ee5fbf57e040d04528c4d44e179?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/99317ee5fbf57e040d04528c4d44e179?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Piccalilli","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Piccalilli","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/6864a3872e444ed8a46d4e28a71883e3","url":"https://daily.dev/sources/piccalilli"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/a-decent-custom-checkbox-pattern-for-until-checkmark-is-ready-j4bey2vsd","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":9},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"css,html,accessibility","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Piccalilli","item":"https://daily.dev/sources/piccalilli"},{"@type":"ListItem","position":3,"name":"A decent custom checkbox pattern for until ::checkmark is ready"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/a-decent-custom-checkbox-pattern-for-until-checkmark-is-ready-j4bey2vsd#faq","mainEntity":[{"@type":"Question","name":"How do I style a custom checkbox with CSS while keeping it accessible and focusable?","acceptedAnswer":{"@type":"Answer","text":"Keep the native input in the DOM but visually hide it with appearance: none and absolute positioning inside a relatively positioned box, so it remains focusable and shows a focus ring. Use :has(input:checked) on the box to change its background, and a sibling selector like input:checked + svg to reveal an SVG checkmark, all sized with em units so the component scales with font-size. Developers building accessible custom form controls can find implementation patterns like this one on daily.dev."}},{"@type":"Question","name":"What CSS feature will eventually let me style checkbox checkmarks natively without hacks?","acceptedAnswer":{"@type":"Answer","text":"The ::checkmark pseudo-element, defined in the CSS Forms spec, represents the checked indicator on checkboxes, radios, and option elements, and paired with appearance: base it would let developers set a custom checkmark image directly via CSS content. No browser is currently working on implementing it, so developers still need workaround patterns using hidden native inputs and SVG icons. Track emerging CSS capabilities like this one on daily.dev before rebuilding form styling workarounds."}}]}
```

