Skip to content

HTML switch control#3342

Open
ramiy wants to merge 7 commits intoweb-platform-dx:mainfrom
ramiy:switch-control
Open

HTML switch control#3342
ramiy wants to merge 7 commits intoweb-platform-dx:mainfrom
ramiy:switch-control

Conversation

@ramiy
Copy link
Copy Markdown
Contributor

@ramiy ramiy commented Sep 11, 2025

HTML form control that implement native switcher functionality in a checkbox, using the switch attribute.

<input type=checkbox switch>
<input type=checkbox switch checked>

Part of Safari 17.4: https://webkit.org/blog/15054/an-html-switch-control/

See also:

@github-actions github-actions bot added the feature definition Creating or defining new features or groups of features. label Sep 11, 2025
@captainbrosset
Copy link
Copy Markdown
Contributor

Thank you for creating this, and sorry about the delay.

We will need a link to a specification or proposal here. Has Apple shared a proposal document somewhere about this?

Also, feature YAML files also need to be accompanied by a .yml.dist file, which you can generate by doing this locally:
npm install
npm run dist features/switch-control.yml

Once done, you can commit the new file and push again to this branch.

@captainbrosset
Copy link
Copy Markdown
Contributor

whatwg/html#9546 seems to be the closest thing there is to a spec.

Copy link
Copy Markdown
Contributor

@captainbrosset captainbrosset left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We now have a BCD key for this control. Let's use it here.

@captainbrosset
Copy link
Copy Markdown
Contributor

captainbrosset commented Feb 20, 2026

@ramiy apologies for leaving this PR untouched for so long. Are you still interested and able to work on it? If so, please take a look at my suggestion, then also update your local branch (git pull origin main and npm install) and re-generate the dist file (npm run dist).

Oh, and I just realized, we need to spec too. The closest thing to a spec is: whatwg/html#9546

Can you add spec: https://github.com/whatwg/html/pull/9546 to the yml file?

EDIT: I've committed the suggestions I made for the name, description, BCD key, and spec.

But, that's not all, since this isn't a valid spec, you'll also need to add an exception for it in /scripts/specs.ts, see the defaultAllowlist array.

Let me know if you're not planning on working on this, and I can finalize the feature for you instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature definition Creating or defining new features or groups of features.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants