I want a native HTML spoiler / content warning element
Submitted by jimmy frasche
Permalink https://webwewant.fyi/wants/6766d578-da25-4cf3-bf09-e0aabca37d5d/
This idea is currently being discussed.
As a user, I encounter spoiler tags and content warnings all over the web — on social media platforms, forums, fan communities, and news sites. The need is ubiquitous, yet every site implements it differently and none of them handle accessibility particularly well.
I want a native HTML element (something like <spoiler> or <cw>) that gives users a consistent, accessible interface for revealing hidden or potentially sensitive content. The existing <details>/<summary> pattern is often suggested as a workaround, but it does not map to this use case for a variety of reasons: it conveys the wrong semantics to assistive technology, it does not support content warnings that require acknowledgment before reveal, and its default styling and interaction model are inappropriate for spoiler/CW use cases.
A purpose-built element would:
- Communicate clear semantics to screen readers (e.g., "content warning: spoilers — activate to reveal").
- Provide a consistent default interaction model across browsers, while remaining styleable.
- Support an optional warning/label attribute that describes what is being hidden.
- Be focusable and keyboard-operable without custom JavaScript.
Millions of people rely on content warnings to protect themselves from distressing material. They deserve a web standard that handles this well.
- Votes
- 0
What are votes for and how are they tallied?