---
title: "An HTML Switch Control"
description: "Safari 17.4 adds a native HTML switch control via `<input type=checkbox switch>`, which falls back to a plain checkbox in browsers without support."
url: "https://swe.quest/articles/an-html-switch-control-f6ff0673a2bcdfca"
canonical: "https://webkit.org/blog/15054/an-html-switch-control/"
source: "WebKit"
published: "2024-02-28"
difficulty: "medium"
kind: "Announcement"
reading_minutes: 3
tags: ["browsers","frontend","accessibility","css"]
---

# An HTML Switch Control

A post on [WebKit](https://swe.quest/sources/webkit.md), published 2024-02-28, 3 min read, Announcement. Original: [https://webkit.org/blog/15054/an-html-switch-control/](https://webkit.org/blog/15054/an-html-switch-control/)

## Summary

Safari 17.4 adds a native HTML switch control via \`\<input type=checkbox switch\>\`, which falls back to a plain checkbox in browsers without support. It mirrors the checkbox API (\`:indeterminate\` never matches), uses the ARIA switch role with On/Off announcements and OS accessibility indicators, and supports vertical writing modes. It also honors \`accent-color\` on the track, and \`appearance: none\` resets all properties to initial values for full custom styling. Use a switch for on/off settings and a checkbox for selection. Experimental \`::thumb\` and \`::track\` pseudo-elements sit behind a feature flag pending standardization.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Browsers](https://swe.quest/tags/browsers.md) (Web & mobile)
- [Frontend](https://swe.quest/tags/frontend.md) (Web & mobile)
- [Accessibility](https://swe.quest/tags/accessibility.md) (Web & mobile)
- [CSS](https://swe.quest/tags/css.md) (Web & mobile)

## Prerequisites

- HTML form controls
- CSS appearance property ([easy posts on CSS](https://swe.quest/tags/css.md?difficulty=easy))

## Keywords

Safari 17.4, WebKit, input type=checkbox switch, ARIA switch role, accent-color, ::thumb pseudo-element

## Related posts

- [The golden rule of Customizable Select](https://swe.quest/articles/the-golden-rule-of-customizable-select-f338a360afa66726.md): WebKit · 2026-06-15 · Medium · 3 min read · Accessibility, CSS, Browsers, Frontend
  Customizable select, arriving in Safari 27, lets developers fully style \`\<select\>\` elements with custom arrows, icons and swatches while keeping native keyboard navigation and accessibility semantics.
- [Implementing Vertical Form Controls](https://swe.quest/articles/implementing-vertical-form-controls-0957876d48409686.md): WebKit · 2024-03-18 · Medium · 4 min read · Browsers, CSS, Frontend
  Safari 17.4 supports vertical writing modes (\`writing-mode: vertical-rl\` / \`vertical-lr\`) on button, textarea, progress, meter, input and select elements, part of the Interop 2023 effort for CJK and Mongolian text.
- [WebKit Features for Safari 27.2](https://swe.quest/articles/webkit-features-for-safari-27-2-f545f4ccec69d87b.md): WebKit · 2026-10-26 · Medium · 5 min read · Browsers, CSS, Frontend, Accessibility
  Safari 27.2 refines Customizable Select with a new \`::field-content\` pseudo-element for styling the displayed selected option without \`\<selectedcontent\>\`, adjusts \`appearance: base-select\` UA styles (flex-based button spacing, inherited \`text-overflow\`, simpler \`::picker-icon\`), and uses \`safe\` alignment so large pickers stay within the viewport.
- [WebKit Features in Safari 17.4](https://swe.quest/articles/webkit-features-in-safari-17-4-28d81cae61957dde.md): WebKit · 2024-03-05 · Medium · 31 min read · Browsers, CSS, Frontend
  Safari 17.4 ships 46 web platform features and 146 bug fixes, alongside completion of WebKit's multi-year rewrite of its inline layout engine.
- [Bringing Back Horizontal Rules in Select Elements](https://swe.quest/articles/bringing-back-horizontal-rules-in-select-elements-517d2598537c7cc4.md): WebKit · 2024-01-25 · Medium · 4 min read · Browsers, Frontend, Accessibility
  Safari 17.0 on macOS again renders \`\<hr\>\` elements placed between \`\<option\>\`s in a \`\<select\>\` as horizontal separator lines.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
