Text Animations

Rime

Hoarfrost taking a word — Molten's opposite number, the same idea of type as a coverage field run cold. Crystal tips seeded on the glyph edges creep across the letters, fork at a fixed lattice angle, and die where they run out of glyph or hit ice already there, so the cost tracks the growing edge rather than the area. The text underneath is never redrawn: it stays a real span at its real colour the whole time, which makes the thaw nothing more than fading the ice off type that was always there.

Install

# Rime needs no npm packages

Then copy 2 files into your project:

  • components/registry/rime/rime.tsx
  • hooks/use-animation-loop.ts

Props

PropTypeDefaultDescription
mode"loop" | "hover" | "hold""loop"What drives the freeze. Loop grows the crystal, holds it, thaws it and starts a new one. Hover rests frozen and clears under the pointer, regrowing once it has fully melted. Hold is the mirror of a melt: ice advances only while the pointer is down and retreats the moment it lifts.
growthnumber1How fast the crystal front advances. This is a budget of steps per second shared across every live tip, so a heavily branched frost spreads each tip more slowly — which is exactly how a real front behaves as it runs out of room.
branchingnumber0.55How readily a tip splits in two, and the difference between needles and ferns. Forks are quantised to a sixty-degree lattice angle on purpose: free angles read as mould rather than as ice.
densitynumber0.7Ceiling on how many tips may be alive at once, which decides how much ice the letters hold before the front runs out of room and the freeze completes. Low leaves the type legible under a tracery; high buries it.
seedsnumber14How many places the frost starts from. Every seed lands on a glyph edge rather than in the middle of a stem, because that is where condensation actually nucleates — and it is why the ice always looks like it arrived from outside the letter.
thawnumber1How fast the ice clears. The crystal is not redrawn to melt it — the overlay simply fades — so this is free at any speed and the word beneath is legible throughout.
holdnumber1.5Seconds spent at full freeze before the thaw begins. The pause is what lets the finished crystal be looked at; without it the loop reads as a shimmer rather than as a process with an end.
sparklenumber0.35Glints on the facets, sampled from points the front actually passed through rather than scattered over the box. They fade with the thaw, so the last thing to go is the light.
frostColorstring (hex)"#d6ecff"The ice. The crystal is stored white and tinted on the way out, so this repaints the whole thing without touching a single stored segment.
baseColorstring (hex)"#e9e6f2"The type underneath, which never moves and is never redrawn.

What It Demonstrates

Loop
An animation that repeats, a set number of times or infinitely.
Hover effect
Visual change when the cursor moves over an element.
Idle animation
Subtle motion that plays while an element is just sitting there, waiting to be interacted with.
Reveal
Content is uncovered gradually, often by animating a clip-path or mask.

Related Components

Appears In