Elementary Standards
HTMLCSSWeb StandardsSEOBlogStart reading
Home / Blog / Checkboxes Get a Static Indeterminate State
News

Checkboxes Can Finally Start Indeterminate — No JavaScript Required

A small WHATWG pull request formalizes a defaultindeterminate attribute for <input type="checkbox">, closing a gap that has forced server-rendered and static pages into a JavaScript workaround since the IDL property first shipped.

Checkboxes have had an indeterminate state since browsers first implemented it as a scripting-only IDL property: set checkbox.indeterminate = true in JavaScript, and the box renders as a dash instead of a tick or an empty square. What it never had was a way to say the same thing in markup. On November 9, the WHATWG HTML Living Standard repository merged a pull request adding a new defaultindeterminate content attribute, reflected by a parallel defaultIndeterminate IDL property, so a checkbox can start indeterminate without a line of script. Teams whose pages are assembled by a static site generator or rendered server-side will feel this one directly: that's the kind of work a web and app development agency ships for clients who need forms and dashboards working correctly before the JS bundle even arrives, which makes this a genuinely practical fix rather than a cosmetic one.

UncheckedCheckedIndeterminate — now settable in HTMLdefaultindeterminate

What changed, exactly

The content attribute works the same way checked already does for the checked state: it sets the initial value, and that initial value is what the checkbox resets back to when its form is reset. Until something marks the checkbox's indeterminateness as "dirty" (a user clicking it, or script invoking the live indeterminate IDL attribute), the box reflects whatever defaultindeterminate says. That distinction matters: the new attribute does not replace indeterminate, it gives it a static starting point, the same relationship checked has to the live checked state.

Before this, a developer who wanted a checkbox to render indeterminate on first paint had exactly one option: ship a tiny inline script that ran before or during hydration and flipped the IDL property. That is a workaround static HTML generators, templating languages, and server-rendered frameworks cannot express cleanly, since there is no script execution step in a pure HTML output. A form library that renders "select all" headers for partially-selected table rows, or a settings panel with a tri-state toggle, has had to either accept a flash of the wrong state or bolt on client-side JS purely to fix an attribute that should have existed from day one.

What this means for developers

Practically, this closes a small but recurring gap in forms that use the indeterminate state as a real UI signal rather than a decoration. "Select all" checkboxes above a list, nested permission trees, and bulk-action tables are the usual suspects. Once browsers ship support, you will be able to write <input type="checkbox" defaultindeterminate> directly in server-rendered or statically generated markup and have it paint correctly before any script runs, with no flash of an incorrect checked or unchecked state and no hydration mismatch between what the server sent and what the client renders.

It is also a cleaner model for component libraries: a design system's checkbox component can expose defaultIndeterminate as a plain prop that maps onto a content attribute, instead of reaching for a ref and an effect just to set indeterminate state once. Form resets become predictable too, since the box returns to its authored default rather than whatever state a prior interaction left it in.

When does this ship

The spec text landed in the WHATWG HTML Living Standard first; browser implementation is the next, separate step, and it is already moving. Chromium's public issue tracker shows active work: a feature flag landed on November 11, with core attribute handling, cloning behavior, and form-reset logic following over the subsequent week. The change was also filed as an official Intent to Prototype on the blink-dev mailing list, the formal step Chromium engineers take before experimental code reaches even a flag-gated build. None of that is a shipping announcement yet. There is no stable-channel date, and Firefox and Safari have not posted parallel implementation intents as of this writing, but a merged spec plus an active Chromium prototype is usually the fastest path a new HTML attribute takes toward real browser support. Worth tracking via the Chromium issue tracker entry if this affects a component you maintain.

For now, the safe move is the same one that has always worked for progressive enhancement: keep the JavaScript fallback that sets indeterminate via script for browsers that haven't implemented the attribute yet, and add defaultindeterminate alongside it. Once support lands, the script becomes redundant rather than required, and you can remove it without touching markup.

Back to the blog
More notes

Keep reading