Declarative scroll commands for HTMLButtonElement
- Category
- DOM
- Type
- New or changed feature
- Status
- Proposed (Chrome Proposed)
- Intent stage
- None
Summary
A set of new `command` values for the `HTMLButtonElement` to declaratively control the scroll position of a target element. This allows authors to create custom scrolling UI (e.g., for carousels or galleries) without requiring JavaScript, improving accessibility and simplifying implementation.
Motivation
Authors frequently build custom components that contain a scrollable region, such as: A horizontal carousel of products or images. A vertically scrolling list of items within a modal. A 2D scrolling area for a map or canvas. These components almost always require custom "Next," "Previous," "Up," or "Down" buttons. Currently, authors must write JavaScript to wire these buttons up. This proposal moves this common, repetitive behavior into the platform, making it declarative, robust, and accessible by default.
Standards & signals
- Firefox: No signal
- Safari: No signal
- Web developers: No signals
- Tracking bug: https://g-issues.chromium.org/issues/457939344
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=declarative-scroll-commands-for-htmlbuttonelement
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+Declarative%20scroll%20commands%20for%20HTMLButtonElement
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=Declarative%20scroll%20commands%20for%20HTMLButtonElement
- Baseline status: https://webstatus.dev/?q=Declarative%20scroll%20commands%20for%20HTMLButtonElement
Explainers: https://github.com/danielsakhapov/declarative-scroll-commands-for-html-explainer