SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

ScrollScene

A scroll-linked scene.

Scroll inside this panel

Keycaps
Plate
Case

Under reduced motion the layers rest apart, in normal flow.

View code
tsx
<ScrollScene timeline="layers" length={2}>
	{LAYERS.map((layer, index) => (
		<div
			mix={[
				raw({ translate: `0 ${index * 3}rem` }),
				sceneMotion("layers", { from: { translate: "0 0" } }, "contain 10% contain 80%"),
			]}
		/>
	))}
</ScrollScene>

Demo landings

Whole pages built only from @sdxc/ui, each for an invented product with its own palette and type. They open in a new tab.

Every demo, landings and docs sites alike, is listed in the demo gallery.

Installation

An ordinary dependency: install it, import the theme once, and import the component where it is used.

Terminal
npm add @sdxc/ui remix
typescript
import "@sdxc/ui/theme.css";

Usage

typescript
import { ScrollScene } from "@sdxc/ui/landing";

Renders the runway and a sticky stage centred under --ui-landing-header-height, all in CSS with nothing to hydrate; inside a scroll panel, set --ui-scroll-scene-viewport to its height. Without view timelines, or under reduced motion, the stage sits in normal flow as a still frame.

Props

Read from the component's own types, so every prop, every default and every allowed value is listed.

PropTypeRequiredDescription
timelinestringYesThe view timeline's name without its leading dashes; sceneMotion takes the same.
lengthnumberNoViewport heights of scroll the stage stays pinned for. A longer runway plays the scene more slowly against the reader's scroll.
childrenRemixNodeYesThe stage: the drawing and whatever annotates it, sized to fit under the header.

Also accepts everything in TagProps<"div">.

Other components this module publishes.

  • sceneMotion
@sdxc/ui

Can’t find it? Contact us