Scroll Spin

@sushindustries/ui

Rotates its children with the page scroll.

4 min read
View as MarkdownEdit on GitHub

Composing it

ScrollSpin draws its own stage - a square box sized against its container's width and the viewport height, centred, with the perspective that makes the turn read as an object rather than a flat rotation. It needs a parent with real width; inside something collapsed to zero (a flex child with no basis) the square collapses with it.

When not to use it

For anything that has to stay readable while it turns - body text, a form, a diagram with labels around its edge. The rotation is the whole point for a mark or a logo; it works against comprehension for anything a reader needs to parse mid-turn.

UsesuseScrollTurnuseScrollTurnScroll position as a rotation, delivered once per frame. Drives a CSS transform or a three.js object, never React state.@sushindustries/ui · motion