Reveal

@sushindustries/ui

Fades and rises its children the first time they reach the viewport. Never un-reveals.

4 min read
View as MarkdownEdit on GitHub

Examples are the tab where the component is shown doing a job, not demonstrating a prop. The API tab already lists the props.

Viewport width
Phone22remthe floor, the narrowest this promises to work at
tanstacktanstack add https://adamjurek.com/r/tanstack/reveal.jsonshadcnpnpm dlx shadcn@latest add https://adamjurek.com/r/shadcn/reveal.json

Press Compare. The frames are real viewports, so a layout that breaks at 320 breaks here too rather than in somebody's hands.

In a page

import { Reveal } from "@sushindustries/ui";

export function FeatureList() {
	return (
		<ul className="flex flex-col gap-4">
			{["Fast", "Typed", "Composable"].map((label, index) => (
				<Reveal key={label} delay={index * 80}>
					<li>{label}</li>
				</Reveal>
			))}
		</ul>
	);
}
tsx

What this example is not

A recipe for every list. Stagger a handful of items - three or four - the way this example does. Past that the last one lands noticeably late, and the delay reads as the page being slow rather than as an effect.