← WebGL UI

swap

A region whose content is replaced, like a page of a paginated list. The ink covers the old text, your code swaps the DOM underneath, and the new text is revealed; the height follows and focus lands on the new content.

Page 1

Form follows function — that has been misunderstood. Form and function should be one.

With a view transition

The same swap run inside document.startViewTransition(): the browser morphs the region's box.

Page 1

Less, but better.