Number 16: Sweeping headline phrase
Specification
- Catalogue
- No. 16 of 110
- Section
- Text and code
- Interaction
- Text Animation
- Element
- Text
- Preview
- Live component
- Imports
- react 19.3.1
- Added
Notes
The end of the headline changes, each new phrase drawn in by a band of light.
One headline can speak to several kinds of buyer. It plays through once, then rests on the first phrase, so it never keeps moving while someone reads.
2.4s shown, 0.6s wipe out, 0.9s sweep in. cubic-bezier(.65, 0, .35, 1). One round, then rests; slot as wide as the longest phrase.
Code
React and plain CSS"use client";
import { PhraseSweep } from "@/components/pieces/kit/phrase-sweep";
import type { LivePreviewProps } from "@/components/live/types";
import { PieceStage } from "@/components/pieces/stage/PieceStage";
import "./phrase-sweep.css";
function PhraseSweepDemo() {
return (
<div className="dm">
<h2 className="dm-hero-h">
Websites that
<br />
<PhraseSweep phrases={["win the enquiry", "load in a blink", "sound like you"]} />
</h2>
<p className="dm-hint">Plays once, then rests. Press Replay to see it again.</p>
</div>
);
}
export default function PhraseSweepEntry(props: LivePreviewProps) {
return (
<PieceStage {...props} label="Sweeping headline phrase" replay>
<PhraseSweepDemo />
</PieceStage>
);
}