Try 'magnetic button'
View code

Specification

Catalogue
No. 16 of 110
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>
  );
}

More like this

Video poster that opens the player

Press, Layout AnimationMedia and galleries

Hand-drawn emphasis

Text AnimationText and code

Statement that reads with the scroll

Scroll, Text AnimationText and code

Cookie choice that folds away

FeedbackOverlays and toasts

Steps that scroll past a picture that holds

ScrollPage sections

Countdown that turns live

Text AnimationCharts and numbers