On this page
Native first: twelve UI patterns HTML and CSS already handle
Every pattern here is one I've seen shipped as a JavaScript component, often in more than one design system I've worked on. Each one also works with semantic HTML and a little CSS, keyboard and screen reader support included. I rebuilt all twelve that way, linked how design systems ship them, and traced the spec work that made the native versions possible.
Before you start
This isn't a case against design systems. I've spent more than a decade building them (I led Spectrum Web Components at Adobe and started PatternFly Elements at Red Hat), and there are good reasons to wrap any of these patterns in a component: one API for a large team, theming, analytics hooks, framework bindings, browsers you still have to support.
The problem is distance. The people who build a component library know that a modal <dialog> makes the rest of the page inert on its own, so focus can't wander behind it. The people using <ds-modal> often don't, and nothing in the component's API tells them. Each section starts from the HTML, so whichever component you end up using, you know what the platform is doing underneath it.
Every pattern follows the same shape:
- The pattern, and how a few design systems ship it today. I picked a mix of web component and React libraries and linked the component's own page.
- A working demo on CodePen. None of them has a JavaScript panel.
- How it works: what each piece of markup and CSS is doing, and what the browser does for you.
- What changed: the spec work and browser releases that made the native version possible, with a support table for anything that became Baseline in the last three years.
- When you still need JavaScript, because the honest answer is rarely "never."
Some of these only recently became possible without script. Others have worked natively for years and still get rebuilt in JavaScript anyway. Each section opens by saying which.
The support tables are built from web-features and MDN's browser-compat-data each time this site builds, so they shouldn't drift out of date. Each cell is the first version of that browser to ship the feature.
Accordion
Newer Exclusive groups and panel styling arrived between 2024 and 2026.
An accordion is a stack of summaries that each show or hide a panel. The version teams usually reach for a component to get is the exclusive one, where opening a panel closes whichever one was already open.
How design systems ship it
- Web Awesome
<wa-details>groups panels with anameattribute that matches native<details> - Shoelace
<sl-details>its docs build an exclusive group by listening forsl-show - Spectrum Web Components
<sp-accordion>single-open by default; a button witharia-expandedand a region - Radix Accordion
type="single"or"multiple", state held in React - React Aria DisclosureGroup
allowsMultipleExpandedtoggles exclusivity
Demo coming: Exclusive accordion
How it works
Each panel is a <details> element. Giving every one the same name makes them a group: the browser closes the open one when another opens, the same way radio buttons share a name.
<details name="faq" open> <summary>When will my order ship?</summary> <div class="panel">…</div></details><details name="faq"> <summary>Can I change my shipping address?</summary> <div class="panel">…</div></details>The <summary> is exposed as a button with its expanded state, it's in the tab order, and Enter or Space toggles it. Closed panels stay searchable too: find-in-page opens the panel that holds the match in Chrome, Firefox and Safari. (Safari opens it but doesn't yet scroll to the match.)
For the styling, I hid the default marker and drew a chevron on summary::after that rotates when the panel is :open. The fade uses ::details-content, a pseudo-element for everything inside <details> except the summary. Before it existed, there was no handle on the panel itself, so animating one meant wrapping the content and measuring it in script.
.accordion summary::after { transition: rotate 200ms ease;}.accordion details:open > summary::after { rotate: 225deg;}.accordion ::details-content { opacity: 0; transition: opacity 250ms ease, content-visibility 250ms; transition-behavior: allow-discrete;}.accordion details:open::details-content { opacity: 1;}Transitioning content-visibility with allow-discrete keeps the closing panel on screen long enough to fade out. Animating the height to auto needs interpolate-size, which only Chromium has today, so the demo adds it inside @supports and every other browser still gets the fade.
What changed
- Exclusive groups came from the
nameattribute. Chrome 120 and Safari 17.2 shipped it in December 2023, and Firefox 130 followed in September 2024. ::details-contentis defined in CSS Pseudo-Elements Level 4. It shipped in Chrome 131 (November 2024), Safari 18.4 (March 2025) and Firefox 143 (September 2025).:openis in both Selectors Level 4 and the HTML Standard. It matches open<details>,<dialog>and pickers. Safari 26.5 completed support in May 2026. ([open]still works if you need older browsers.)- Transitioning
content-visibilityis what lets a closing panel animate at all, since::details-contenthides withcontent-visibility: hidden.content-visibilitybecame Baseline in September 2025. - Find-in-page opening closed panels has been in Chrome since version 97, and Firefox 148 completed it in February 2026. Safari 26.2 (December 2025) opens the panel but doesn't yet scroll to the matching text.
- Limited availability
- Newly available
- Widely available
| Desktop | Chrome 120 | Edge 120 | Firefox 130Last to ship | Safari 17.2 |
|---|---|---|---|---|
| Mobile | Chrome Android 120 | Firefox Android 130Last to ship | Safari iOS 17.2 |
caniuse MDN Web Platform Status Data from web-features 3.44.0 and MDN browser-compat-data 8.1.7, built 13 November 2026.
- Limited availability
- Newly available
- Widely available
| Desktop | Chrome 131 | Edge 131 | Firefox 143Last to ship | Safari 18.4 |
|---|---|---|---|---|
| Mobile | Chrome Android 131 | Firefox Android 143Last to ship | Safari iOS 18.4 |
caniuse MDN Web Platform Status Data from web-features 3.44.0 and MDN browser-compat-data 8.1.7, built 13 November 2026.
- Limited availability
- Newly available
- Widely available
| Desktop | Chrome 133 | Edge 133 | Firefox 136 | Safari 26.5Last to ship |
|---|---|---|---|---|
| Mobile | Chrome Android 133 | Firefox Android 136 | Safari iOS 26.5Last to ship |
caniuse MDN Web Platform Status Data from web-features 3.44.0 and MDN browser-compat-data 8.1.7, built 13 November 2026.
- Limited availability
- Newly available
- Widely available
| Desktop | Chrome 108 | Edge 108 | Firefox 130 | Safari 26Last to ship |
|---|---|---|---|---|
| Mobile | Chrome Android 108 | Firefox Android 130 | Safari iOS 26Last to ship |
caniuse MDN Web Platform Status Data from web-features 3.44.0 and MDN browser-compat-data 8.1.7, built 13 November 2026.
When you still need JavaScript
- Remembering which panel was open across page loads.
- Arrow-key movement between headers. The APG accordion pattern lists it as optional, and
<details>doesn't do it. - Real heading semantics.
<summary>is exposed as a button, so a heading placed inside it may not show up in a screen reader's heading list. If your panels need to be navigable by heading, the APG version (a heading wrapping a button) still needs script.
Dialog, drawer and sheet
Newer <dialog> has worked since 2022. Opening one without script arrived in December 2025.
A modal dialog takes over the page until you answer it. A drawer is the same thing pinned to an edge. Both need the same hard parts: focus moves in, the page behind can't be reached, Esc closes, and focus returns to whatever opened it.
How design systems ship it
- Red Hat Design System
<rh-dialog>built on native<dialog> - Material Web
<md-dialog>behaves like<dialog>and adds its own focus trap - Shoelace
<sl-drawer>a modal utility that handles focus trapping in script - Headless UI Dialog traps focus and marks the rest of the app inert in script
- Radix Dialog portals into
bodyand makes the content underneath inert
Demo coming: Dialog and drawer
How it works
The open button names its target with commandfor and says what to do with command="show-modal". That's the declarative version of calling showModal(), and it gets the same behavior.
<button commandfor="delete-dialog" command="show-modal">Delete account</button><dialog id="delete-dialog" aria-labelledby="delete-title" closedby="any"> <h2 id="delete-title">Delete your account?</h2> <p>This removes your projects and invoices. It can't be undone.</p> <form method="dialog"> <button value="cancel" autofocus>Cancel</button> <button value="delete">Delete</button> </form></dialog>Here's what the browser does once the modal opens:
- It moves the dialog to the top layer, so no
z-indexor portal is needed. - It makes everything outside the dialog inert, for focus and for the accessibility tree. Tab can still reach the browser's own toolbar, but never the page behind.
- It moves focus inside (to the
autofocusbutton here), and puts it back on the opener when the dialog closes. - Esc closes it.
A <form method="dialog"> closes the dialog on submit and sets its returnValue to the button's value. The drawer closes with command="close" on a plain button.
The drawer is the same element with different margins. I pinned it to the inline end with margin-inline: auto 0, gave it the full block size, and flipped its slide direction under :dir(rtl). One more line stops the page scrolling behind an open modal:
html:has(dialog:modal) { overflow: hidden;}The entry animation uses @starting-style. The exit transitions display and overlay with allow-discrete. In Chromium, that keeps the dialog in the top layer until its fade finishes. Firefox doesn't transition display yet and overlay is Chromium-only, so other engines close it with less animation or none, which is a fine fallback.
What changed
<dialog>itself isn't new. It reached every engine in March 2022, when Firefox 98 and Safari 15.4 shipped it.- Opening without script is new. Invoker commands shipped in Chrome 135 (April 2025), Firefox 144 (October 2025) and Safari 26.2 (December 2025). Before that, every modal
<dialog>needed at least one line of JavaScript to callshowModal(). - Animating in and out of the top layer came with
@starting-styleandtransition-behavior, both Baseline since August 2024. :dir()reached every engine in December 2023, so the drawer can flip for right-to-left pages without a class or attribute check.- Light dismiss (closing on a backdrop click) is the
closedbyattribute, in Chrome 134 and Firefox 141. Safari doesn't support it yet, so I kept a visible close button in both demos.
- Limited availability
- Newly available
- Widely available
| Desktop | Chrome 135 | Edge 135 | Firefox 144 | Safari 26.2Last to ship |
|---|---|---|---|---|
| Mobile | Chrome Android 135 | Firefox Android 144 | Safari iOS 26.2Last to ship |
caniuse MDN Web Platform Status Data from web-features 3.44.0 and MDN browser-compat-data 8.1.7, built 13 November 2026.
- Limited availability
- Newly available
- Widely available
| Desktop | Chrome 117 | Edge 117 | Firefox 129Last to ship | Safari 17.5 |
|---|---|---|---|---|
| Mobile | Chrome Android 117 | Firefox Android 129Last to ship | Safari iOS 17.5 |
caniuse MDN Web Platform Status Data from web-features 3.44.0 and MDN browser-compat-data 8.1.7, built 13 November 2026.
- Limited availability
- Newly available
- Widely available
| Desktop | Chrome 117 | Edge 117 | Firefox 129Last to ship | Safari 17.4 |
|---|---|---|---|---|
| Mobile | Chrome Android 117 | Firefox Android 129Last to ship | Safari iOS 17.4 |
caniuse MDN Web Platform Status Data from web-features 3.44.0 and MDN browser-compat-data 8.1.7, built 13 November 2026.
- Limited availability
- Newly available
- Widely available
| Desktop | Chrome 120 | Edge 120Last to ship | Firefox 49 | Safari 16.4 |
|---|---|---|---|---|
| Mobile | Chrome Android 120 | Firefox Android 49 | Safari iOS 16.4 |
caniuse MDN Web Platform Status Data from web-features 3.44.0 and MDN browser-compat-data 8.1.7, built 13 November 2026.
When you still need JavaScript
- Acting on the result.
returnValuetells you which button closed the dialog, but doing something about it takes script or a real form submission. - Guarding unsaved changes. Stopping a close means listening for the
cancelevent, or usingcommand="request-close"with a listener. - Browsers from before 2025. The invokers polyfill fills in
command, and it's worth loading only wherecommandForElementis missing.
Disclosure nav, toggletip and flyout
Newer Popover reached every engine in 2024, and anchor positioning in January 2026.
A navigation flyout is a button that reveals a panel of links next to it. A toggletip is the same idea on a smaller scale: a button that reveals a short note. Both need to float above the page, stay attached to their button, flip when they'd run off screen, and close when you click away or press Esc.
How design systems ship it
- Web Awesome
<wa-dropdown>positions with<wa-popup>, which uses Floating UI - Spectrum Web Components
<sp-overlay>uses<dialog>orpopoverfor the top layer, with script for positioning - Chakra UI Popover configures Floating UI positioning; its Toggle Tip wraps it
- Radix Navigation Menu open state and positioning in React
- Carbon Toggletip usage guidance; the linked implementation is React
Demo coming: Disclosure nav and toggletip
How it works
Each panel has the popover attribute, and its button points at it with command="toggle-popover".
<button id="products-trigger" commandfor="products-menu" command="toggle-popover">Products</button><div id="products-menu" class="flyout" popover> <ul> <li><a href="/invoicing">Invoicing</a></li> <li><a href="/payroll">Payroll</a></li> </ul></div>A plain popover is an auto popover, and that gets you a lot:
- It renders in the top layer.
- It light-dismisses when you click outside it or press Esc.
- Opening one closes any other open
autopopover that isn't its ancestor, which is why opening "Resources" closes "Products". - The browser exposes the button's expanded state to assistive tech.
The expanded state lives in the accessibility tree, not in the DOM, so [aria-expanded="true"] won't match anything. I styled the open chevron with .nav-trigger:has(+ :popover-open) instead.
Anchor positioning keeps each panel attached to its button:
#products-trigger { anchor-name: --products;}#products-menu { position-anchor: --products; inset: auto; position-area: block-end span-inline-end; position-try-fallbacks: flip-inline;}position-area places the panel below the button, aligned to its start edge. position-try-fallbacks flips it to the other side when there isn't room. I named each anchor explicitly rather than relying on the implicit anchor a popover gets from its invoker. The explicit names make the CSS easier to read, and they don't depend on how each engine wires up the invoker. All of it sits inside @supports (anchor-name: --a). Without support, a popover falls back to the center of the viewport, which is usable if not pretty.
This is a disclosure navigation, not a menu button. A list of links doesn't get role="menu", and it shouldn't, since that role promises arrow-key behavior that nothing here provides.
What changed
- The
popoverattribute shipped in Chrome 114 (May 2023), Safari 17 (September 2023) and Firefox 125 (April 2024). web-features dates the whole feature to January 2025, when Safari on iOS 18.3 added the last piece, theHTMLElement.popoverproperty. The attribute itself has worked everywhere since April 2024. - Anchor positioning is defined in CSS Anchor Positioning Level 1. Chrome 125 shipped it in May 2024, with some properties under earlier names;
position-try-fallbacksandposition-areagot their current names in Chrome 128 and 129. Safari 26 followed in September 2025 and Firefox 147 in January 2026. The feature as a whole isn't Baseline yet, becauseposition-visibility: anchor-validandanchor-visibleare still Safari-only. Nothing in the demo uses them. command="toggle-popover"is an invoker command (Baseline December 2025). The olderpopovertargetattribute does the same job and has been supported since 2024. I usedcommandso it matches the dialog demo.
popover Baseline- Limited availability
- Newly available
- Widely available
| Desktop | Chrome 114 | Edge 114 | Firefox 125Last to ship | Safari 17 |
|---|---|---|---|---|
| Mobile | Chrome Android 114 | Firefox Android 125Last to ship | Safari iOS 17 |
caniuse MDN Web Platform Status Data from web-features 3.44.0 and MDN browser-compat-data 8.1.7, built 13 November 2026.
anchor-name Baseline- Limited availability
- Newly available
- Widely available
| Desktop | Chrome 125 | Edge 125 | Firefox 147Last to ship | Safari 26 |
|---|---|---|---|---|
| Mobile | Chrome Android 125 | Firefox Android 147Last to ship | Safari iOS 26 |
caniuse MDN Web Platform Status Data from web-features 3.44.0 and MDN browser-compat-data 8.1.7, built 13 November 2026.
position-area Baseline- Limited availability
- Newly available
- Widely available
| Desktop | Chrome 129 | Edge 129 | Firefox 147Last to ship | Safari 26 |
|---|---|---|---|---|
| Mobile | Chrome Android 129 | Firefox Android 147Last to ship | Safari iOS 26 |
caniuse MDN Web Platform Status Data from web-features 3.44.0 and MDN browser-compat-data 8.1.7, built 13 November 2026.
When you still need JavaScript
- A real application menu with
role="menu", arrow keys and typeahead. - Closing the flyout when focus tabs out of it. Light dismiss covers clicks and Esc, not focus leaving.
- Opening on hover. Interest invokers (
interestfor) do it natively, but only in Chromium so far. - Older browsers. OddBird maintains polyfills for popover and anchor positioning.
Toggle switch
Long-standing Has worked natively since 2022.
A switch is an on/off control that takes effect right away, like a light switch. It reads differently from a checkbox, which usually means "include this when I submit."
How design systems ship it
- Spectrum Web Components
<sp-switch>an<input type="checkbox">withrole="switch" - Material Web
<md-switch>takes part in form submission like a checkbox - Red Hat Design System
<rh-switch>role="switch"witharia-checked - Headless UI Switch recreates checkbox semantics and renders a hidden input for forms
- Radix Switch a visually hidden input for form submission
Demo coming: Toggle switch
How it works
It's a checkbox. Adding role="switch" changes what a screen reader says ("switch, on" instead of "checkbox, checked"), and everything else stays native: the label, Space to toggle, form submission, :checked, :disabled.
<label class="switch-row"> Email digests <input type="checkbox" role="switch" switch name="digest" checked></label>appearance: none removes the native box, so the input itself becomes the track and ::before becomes the thumb. When it's checked, a checkmark drawn on ::after appears too, so the state never depends on color alone. A forced-colors block keeps it visible in Windows high contrast mode.
[role="switch"] { appearance: none; position: relative; inline-size: 2.7rem; block-size: 1.5rem; border-radius: 999px;}[role="switch"]::before { content: ""; position: absolute; /* the thumb */}[role="switch"]:checked::before { translate: 1.2rem 0;}The switch attribute is a Safari addition. On its own, Safari draws a native switch for it; appearance: none overrides that, so the demo looks the same everywhere. I left the attribute in because it costs nothing and should pay off once more browsers support it.
What changed
Nothing recent, which is the point. role="switch" arrived in WAI-ARIA 1.1 in 2017, and unprefixed appearance reached every engine in March 2022. The only new piece is Safari's native <input type="checkbox" switch> (Safari 17.4, March 2024). No other engine has shipped it yet, which is why the demo doesn't depend on it.
When you still need JavaScript
- Making it take effect immediately. A switch implies the change happens the moment you flip it, and saving that change somewhere needs script or a form submission.
- Dragging the thumb. Clicking and Space work natively; a drag gesture doesn't.
Auto-growing textarea
Newer Auto-sizing reached every engine in June 2026.
A textarea that grows as you type, so you can see everything you've written without a scrollbar inside a scrollbar.
How design systems ship it
- MUI Textarea Autosize replaces
<textarea>and resizes on keyboard and window resize events - Mantine Textarea
autosize,minRowsandmaxRowsprops - Chakra UI Textarea an
autoresizeprop, withmaxH="5lh"suggested as a cap - Shoelace
<sl-textarea>resize="auto" - Spectrum Web Components
<sp-textfield>multilinewithgrows
Demo coming: Auto-growing textarea
How it works
One property.
textarea { field-sizing: content; inline-size: 100%; min-block-size: 3lh; max-block-size: 10lh;}input { field-sizing: content; min-inline-size: 10ch; max-inline-size: 100%;}field-sizing: content tells a form control to size itself to its content, the way most elements already do. The rest is guardrails:
- A fixed inline size stops the textarea shrinking sideways when a long placeholder clears.
lhunits set the minimum and maximum in lines of text, so it starts at three lines and scrolls after ten.- The single-line input grows sideways, with a floor so it never collapses to nothing and a ceiling at its container.
An explicit width or height overrides field-sizing. If your reset sets textarea { height: 8rem }, take it back out.
What changed
field-sizingis defined in CSS Form Control Styling Level 1. Chrome 123 shipped it in March 2024, Safari 26.2 in December 2025, and Firefox 152 in June 2026, which made it Baseline.- The
lhunit became Baseline in November 2023. Before that, the cap had to be a guess inrem.
- Limited availability
- Newly available
- Widely available
| Desktop | Chrome 123 | Edge 123 | Firefox 152Last to ship | Safari 26.2 |
|---|---|---|---|---|
| Mobile | Chrome Android 123 | Firefox Android 152Last to ship | Safari iOS 26.2 |
caniuse MDN Web Platform Status Data from web-features 3.44.0 and MDN browser-compat-data 8.1.7, built 13 November 2026.
- Limited availability
- Newly available
- Widely available
| Desktop | Chrome 109 | Edge 109 | Firefox 120Last to ship | Safari 16.4 |
|---|---|---|---|---|
| Mobile | Chrome Android 109 | Firefox Android 120Last to ship | Safari iOS 16.4 |
caniuse Web Platform Status Data from web-features 3.44.0 and MDN browser-compat-data 8.1.7, built 13 November 2026.
When you still need JavaScript
- Growing in browsers from before mid-2026. Without the property you get a normal fixed textarea with a scrollbar, which is a perfectly good fallback. Matching the growth exactly takes an input listener.
- Character counters and "you've hit the limit" messages.
Validation states
Newer The timing pseudo-classes reached every engine in November 2023.
A field should turn red when you've gotten something wrong, not while you're still typing it, and not as soon as the page loads. That timing is most of the reason form libraries track "touched" and "dirty" state.
How design systems ship it
- Shoelace form controls
data-user-invalidattributes, which its docs call a workaround until custom states were supported - Web Awesome form controls
:state(user-invalid)custom states that work alongside:user-invalid - Radix Form built on the browser's constraint validation API
- MUI Text Field an
errorprop that you set from your own state - Lion Validate a separate validator system with error, warning, info and success levels
Demo coming: Validation states
How it works
The rules are plain HTML attributes: required, type="email", minlength. CSS handles the timing.
.field input:user-invalid { border-color: var(--error);}.field:has(input:user-invalid) .error { display: flex;}.field input:user-valid { border-color: var(--success);}:user-invalid matches only after the user has changed the value and moved on, or has tried to submit the form. Tabbing past an empty required field doesn't trigger it. Typing half an email address doesn't either, until you leave the field. On submit, the browser stops the submission, focuses the first invalid field and shows its own message, and every invalid field picks up the style at once.
:has() lets the wrapper react to its input, so the error message and hint can change without a class toggled from script. Each error starts with a "!" drawn in CSS, so the state never relies on color alone. The / "" alt text on that generated content keeps it out of the accessible name.
The demo uses method="dialog" on a form outside any dialog. The browser still validates it on submit, but a valid submission goes nowhere, which is exactly what a demo needs.
What changed
:user-invalidand:user-validare in both Selectors Level 4 and the HTML Standard. Firefox has had them since version 88 (2021). Safari 16.5 added them in May 2023 and Chrome 119 in October 2023, which made them Baseline in November 2023.:has()became Baseline in December 2023, when Firefox 121 shipped it.- Alt text for generated content (
content: "!" / "") became Baseline in July 2024, when Firefox 128 shipped it.
- Limited availability
- Newly available
- Widely available
| Desktop | Chrome 119 | Edge 119Last to ship | Firefox 88 | Safari 16.5 |
|---|---|---|---|---|
| Mobile | Chrome Android 119 | Firefox Android 88 | Safari iOS 16.5 |
caniuse MDN Web Platform Status Data from web-features 3.44.0 and MDN browser-compat-data 8.1.7, built 13 November 2026.
- Limited availability
- Newly available
- Widely available
| Desktop | Chrome 105 | Edge 105 | Firefox 121Last to ship | Safari 15.4 |
|---|---|---|---|---|
| Mobile | Chrome Android 105 | Firefox Android 121Last to ship | Safari iOS 15.4 |
caniuse MDN Web Platform Status Data from web-features 3.44.0 and MDN browser-compat-data 8.1.7, built 13 November 2026.
- Limited availability
- Newly available
- Widely available
| Desktop | Chrome 77 | Edge 79 | Firefox 128Last to ship | Safari 17.4 |
|---|---|---|---|---|
| Mobile | Chrome Android 77 | Firefox Android 128Last to ship | Safari iOS 17.4 |
caniuse Web Platform Status Data from web-features 3.44.0 and MDN browser-compat-data 8.1.7, built 13 November 2026.
When you still need JavaScript
- Connecting your own error message to the field. Browsers expose the invalid state to assistive tech once the user has interacted, but the visible message isn't linked to anything.
aria-errormessageonly applies alongside a realaria-invalidattribute, and:user-invaliddoesn't set one, so wiring the message up takes a few lines of script. - Rules HTML can't express, like "passwords must match." That's
setCustomValidity(). - Errors that come back from the server.
Skip link
Long-standing Has worked for as long as in-page links have.
The first thing a keyboard user can focus on a page, and the way past a header full of links. It's one way a page meets WCAG 2.4.1, Bypass Blocks.
How design systems ship it
Few systems ship this one at all.
- Red Hat Design System
<rh-skip-link>a styled link that should be the first focusable element - Chakra UI Skip Nav a link plus a matching content target component
- PatternFly Skip to content React and HTML
- Carbon UI shell header skip link guidance inside the header component
Demo coming: Skip link
How it works
<a class="skip-link" href="#main">Skip to main content</a><header>…</header><main id="main" tabindex="-1">…</main>It's an in-page link. Following it scrolls to #main, and the tabindex="-1" makes <main> focusable, so the next Tab starts from inside the content. (Most browsers move the sequential focus starting point to the target without it, but the attribute makes it reliable.) The CSS hides the link above the viewport with translate and brings it back on :focus-visible.
.skip-link { position: absolute; translate: 0 calc(-100% - 1rem);}.skip-link:focus-visible { translate: 0;}Avoid display: none or visibility: hidden for the hidden state. Both take the link out of the tab order, which defeats the point.
What changed
Nothing. Fragment links are as old as the web. :focus-visible, the newest piece here, became Baseline in March 2022.
When you still need JavaScript
You don't, for the link itself. Single-page apps that swap content without a page load need script to move focus after each route change, but that's a router problem, not a skip-link one.
Breadcrumbs
Long-standing Has worked since HTML5 added <nav>.
A trail from the top of the site to the current page.
How design systems ship it
- Red Hat Design System
<rh-breadcrumb>you slot an<ol>of links; the light DOM is the semantic HTML - Spectrum Web Components
<sp-breadcrumbs>renders a<ul>, then addsrole="listitem"andaria-currentin script - Web Awesome
<wa-breadcrumb>setsaria-current="page"on the last item for you - MUI Breadcrumbs renders an
<ol>inside a labeled<nav> - React Aria Breadcrumbs its docs ask you to wrap it in a
<nav>
Demo coming: Breadcrumbs
How it works
<nav aria-label="Breadcrumb"> <ol> <li><a href="/">Home</a></li> <li><a href="/clients/">Clients</a></li> <li><a href="/clients/acme/invoices/1048/" aria-current="page">Invoice 1048</a></li> </ol></nav>The <nav> with a label makes it a named landmark, the <ol> tells a screen reader how many steps there are and where you are in them, and aria-current="page" marks the last one. The separators are generated content with empty alt text, so they're drawn but not read:
.breadcrumbs li + li::before { content: "/" / "";}.breadcrumbs [aria-current="page"] { font-weight: 600; text-decoration: none;}Styling off [aria-current="page"] rather than a .current class means the visual state and the accessible state can't drift apart.
What changed
The markup has worked since <nav> arrived with HTML5. The one recent piece is the alt text on the separator, Baseline since July 2024. Before that, the usual approach was an aria-hidden span in every list item, or a separator some screen readers would read aloud.
- Limited availability
- Newly available
- Widely available
| Desktop | Chrome 77 | Edge 79 | Firefox 128Last to ship | Safari 17.4 |
|---|---|---|---|---|
| Mobile | Chrome Android 77 | Firefox Android 128Last to ship | Safari iOS 17.4 |
caniuse Web Platform Status Data from web-features 3.44.0 and MDN browser-compat-data 8.1.7, built 13 November 2026.
When you still need JavaScript
Collapsing a long trail into a "…" menu on small screens. Wrapping, as the demo does, needs nothing.
Clickable card
Long-standing The stretched link has worked for years. The card-level focus ring needs :has(), Baseline since December 2023.
A card you can click anywhere on to open, which still has its own secondary links inside. The cards at the top of this guide work this way.
How design systems ship it
- Chakra UI LinkOverlay stretches a link over its container: the technique below, as a component
- MUI CardActionArea wraps the card's content in one button or link
- Spectrum Web Components
<sp-card href>the whole card acts as one large anchor - Carbon clickable tile the whole tile is clickable, so it can't contain other actions
- Red Hat Design System
<rh-card>interactive elements inside stay separate; no whole-card link option is documented
Demo coming: Clickable card
How it works
Wrapping the whole card in an <a> is the obvious move, and it causes two problems. A screen reader reads the entire card as the link text, and you can't put another link inside, because nested links are invalid. Carbon's tile rules out internal actions for exactly that reason.
The alternative leaves the link on the title and stretches its hit area with a pseudo-element:
.card { position: relative;}.card h2 a::after { content: ""; position: absolute; inset: 0;}.card .secondary { position: relative; z-index: 1;}The link's accessible name is still just the title. The ::after covers the card, so a click anywhere lands on the link. Lifting the secondary links with position: relative and z-index puts them above the overlay, so they stay clickable on their own. :has() moves the hover and focus styles up to the card:
.card:has(h2 a:focus-visible) { outline: 2px solid var(--focus-ring);}What changed
The stretched link works anywhere ::after and inset do, and inset has been Baseline since 2021. The newer part is the card-level focus ring. Before :has(), outlining the whole card on focus meant either outlining the pseudo-element or toggling a class from script.
- Limited availability
- Newly available
- Widely available
| Desktop | Chrome 105 | Edge 105 | Firefox 121Last to ship | Safari 15.4 |
|---|---|---|---|---|
| Mobile | Chrome Android 105 | Firefox Android 121Last to ship | Safari iOS 15.4 |
caniuse MDN Web Platform Status Data from web-features 3.44.0 and MDN browser-compat-data 8.1.7, built 13 November 2026.
When you still need JavaScript
Letting people select the card's text. The overlay sits on top of it, so dragging to select starts a click instead. Scripted cards usually check for a text selection before navigating.
Back to top
Long-standing Has worked for years. Only revealing the button on scroll still needs script.
A link at the end of a long page, or a floating button, that returns you to the start.
How design systems ship it
- Red Hat Design System
<rh-back-to-top>renders a link and shows it after a scroll threshold - PatternFly Elements
<pf-v5-back-to-top>appears after 400 pixels of scrolling by default - PatternFly Back to top listens to window scroll events
- MUI App Bar "Back to top" demo a floating button shown by the
useScrollTrigger()hook
Demo coming: Back to top
How it works
Every one of those links is native. The script in each component exists to hide the link until you've scrolled.
<h1 id="top">Release notes</h1>…<a href="#top">Back to top</a>@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; }}#top is a special fragment: with no element of that ID, it scrolls to the top of the document but leaves focus where it was. Giving the <h1> that ID means the link also moves the focus starting point to the heading, so the next Tab doesn't send a keyboard user back to the bottom. Smooth scrolling sits behind prefers-reduced-motion, and scroll-margin-block-start leaves some room above the heading when it lands.
The demo also has a floating version, always visible. Showing it only after the reader has scrolled down is the one part that needs script today.
What changed
scroll-behavior reached every engine in March 2022 and prefers-reduced-motion in 2020. Revealing the button after scrolling without script is coming: scroll-driven animations or scroll-state() container queries can do it. Neither is Baseline yet: scroll-driven animations are missing only in Firefox, and scroll-state() queries are Chromium-only.
When you still need JavaScript
Showing the floating button only after the reader has scrolled, at least until scroll-driven animations reach Firefox.
Progress and meter
Long-standing Baseline since 2015 and 2018.
A progress bar shows how far along a task is. A meter shows a measurement within a known range, like storage used or a password's strength. They look alike, and HTML has a separate element for each.
How design systems ship it
- Spectrum Web Components
<sp-meter>role="meter progressbar"on a custom element - React Aria Meter a separate component from ProgressBar, as in HTML
- Radix Progress
role="progressbar"rather than<progress> - Material Web
<md-linear-progress>linear and circular variants - MUI Progress linear and circular, no meter
Demo coming: Progress and meter
How it works
<label for="upload">Uploading statements.pdf</label><progress id="upload" max="100" value="62">62%</progress><label for="sync">Syncing with your bank</label><progress id="sync">Syncing</progress><label for="storage">Storage used</label><meter id="storage" min="0" max="10" low="7" high="9" optimum="2" value="8.4">8.4 of 10 GB</meter><progress> with a value is determinate. Without one, it's indeterminate, and the browser says so. <meter> uses low, high and optimum to decide whether the value is good, so-so or bad, and each state gets its own styling hook. Both elements are labelable, so a plain <label for> names them.
Styling is the weak spot. Each engine draws the bar with its own pseudo-elements (::-webkit-progress-value, ::-moz-progress-bar, ::-webkit-meter-optimum-value), so the demo's CSS styles each of them. That's more repetitive than a single div, but you get the semantics, states and labeling without any script.
What changed
Nothing recent. <progress> has been Baseline since 2015 and <meter> since 2018. A standard way to style the bar's parts is under discussion in CSS Form Control Styling.
When you still need JavaScript
Updating the value. Something has to know how far along the upload is. Announcing progress as it changes also needs a live region, since a screen reader won't read every new value on its own.
Sticky header
Long-standing Baseline since 2019.
A header that scrolls with the page until it reaches the top, then stays there.
How design systems ship it
No system I checked has a "sticky header" component. It shows up as an option on an app bar or shell instead.
- MUI App Bar suggests
position="sticky"when a fixed bar hides content - Mantine AppShell every part has a fixed position
- Carbon UI shell header persistent across the product
- Vaadin App Layout scrolling depends on whether the layout has a defined height
Demo coming: Sticky header
How it works
.site-header { position: sticky; inset-block-start: 0;}html { scroll-padding-block-start: calc(var(--header-size) + 1rem);}position: sticky keeps the header in the document flow, so nothing has to reserve space for it, which is the usual trap with position: fixed. The second rule is the one people forget. scroll-padding tells the browser the top of the viewport is covered, so in-page links and focused elements stop below the header instead of underneath it. That's what WCAG 2.4.11, Focus Not Obscured asks for.
The demo's frosted background is backdrop-filter, which became Baseline in September 2024. It's decoration, so a browser without it just shows the solid fallback color.
What changed
position: sticky has been Baseline since 2019 and scroll-padding since 2021. Styling the header differently once it's stuck (a shadow, a smaller logo) is the newer idea, and scroll-state(stuck: top) container queries do it in CSS, but only Chromium has shipped them.
- Limited availability
- Newly available
- Widely available
| Desktop | Chrome 76 | Edge 79 | Firefox 103 | Safari 18Last to ship |
|---|---|---|---|---|
| Mobile | Chrome Android 76 | Firefox Android 103 | Safari iOS 18Last to ship |
caniuse MDN Web Platform Status Data from web-features 3.44.0 and MDN browser-compat-data 8.1.7, built 13 November 2026.
When you still need JavaScript
- A "stuck" style everywhere, until
scroll-state()queries reach other engines. AnIntersectionObserveron a sentinel element is the usual workaround. - Hiding the header as you scroll down and showing it as you scroll up.
About the data
Ship dates come from MDN's browser-compat-data, and Baseline status from web-features, which is built on it. When the two disagreed about what a feature "is" (popover and anchor positioning both have more than one date, depending on which parts you count), I gave both and said which one this guide relies on. Design system notes describe each library's own documentation as of October 2026, not its source code.
Every demo is on CodePen, and none of them has a line of JavaScript. If one breaks in your browser, I'd like to hear about it.