← Back to release summary

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

Ecosystem

Explainers: https://github.com/danielsakhapov/declarative-scroll-commands-for-html-explainer

View on chromestatus.com