Menu

Components

Reveal

A block that rises into place once it is scrolled to: Reveal for a batch that cascades, aka-rise for one block and no script.

Usage

A batch

One

Two

Three

Uses.aka-rise[data-reveal]

import { Reveal } from '@/components/ui/reveal'

<div className="grid grid-cols-3 gap-3">
  <Reveal><div className="aka-card p-4">One</div></Reveal>
  <Reveal><div className="aka-card p-4">Two</div></Reveal>
  <Reveal><div className="aka-card p-4">Three</div></Reveal>
</div>

The transition is CSS on data-reveal; the only thing the client decides is when each member of a batch starts. What is already on screen when the page loads does not animate. The timings are on Motion.

Examples

The rise

A paragraph that rises as it is scrolled into view. Where the browser has no view timeline, or the reader asked for less motion, it is simply here.

<p className="aka-rise">A paragraph that rises as it is scrolled into view.</p>

An animation on the view timeline, where the browser supports it and the reader has not asked for less motion. It replaced an IntersectionObserver that existed to fade in one paragraph, and forced the whole landing section, every plate and every link, to be a client component to hold its one boolean. Longhands only: the animation shorthand resets animation-timeline to auto, and the rise silently becomes a one-shot that has already finished. akaOSS's .settle is the same mechanism with other numbers, 12px over entry 0% to entry 60% against 16px over entry 8% to cover 28%, and translate rather than transform. aka-rise is the system's.

Props

Reveal

Client component

PropDescription
childrenReactNodeThe block to reveal. Shown outright if it is on screen at load.
className?stringOn the wrapping div.

Best practices

When to use

  • Reveal for a group that should arrive in order: a grid of cards, a list of entries.
  • aka-rise for a single block where no script is wanted at all.
  • Neither for content above the fold, or for anything a reader needs before they scroll.

Behaviour

  • Motion moves space: the block rises, it does not fade from nothing.
  • The cascade steps in fixed increments and stops adding delay after a few, so no member waits long.
  • Under reduced motion both render the block in place.

Accessibility

  • Content is never left hidden: without observer support Reveal shows the block and stops.
  • Both are presentational and add nothing to the accessibility tree.