Feature Library

Hero family: five moods from your own words

0.18 GPU · <0.01 CPU ms
A still of the Hero family: five moods from your own words demo
Still
The live demo starts when it’s in view.Move the pointer over the hero

A hero whose scene is built from the page’s own heading.

The words are drawn into a distance field on the GPU, and each of five moods is a world they stand in: Daylight (paper, one slow sun, your numbers cut into the sheets), Glass (the letters are liquid glass that drops fuse with), Murmuration (a flock that parts round the words and lands on them), Stream (the words are stones in running water, solved on the GPU, with your numbers as its bank) and Lurk (the words are the only light, and something passes). One engine under all five: it follows any look through the shared tokens and dials, takes a series, rests off screen, holds a frame under reduced motion and keeps a drawn still without WebGPU.

What it costs a frame

0.18 ms
<0.01 ms
GPU
0.18 ms
CPU, median
<0.01 ms
CPU, 95th pct
0.01 ms
Draw calls
0
Weight
Light

Measured 21 November 2026 on RTX 4060 Laptop, 13th Gen Intel(R) Core(TM) i9-13900H, Chrome 157, 1920×1080 at 1×. 600 frames × 3 rounds, median kept (rounds ranged GPU 0.10–0.21, CPU <0.01–<0.01 ms). What ran: Daylight alone, full stage, in Boardroom: one pass at up to 1280 px wide and 30 updates a second, the heading’s shadow marched through its distance field, four cut sheets from a 12-year series. Phones: tiers are being measured next.

On every machine it was measured on
MachineGPU msCPU msCPU p95
RTX 4060 Laptop · 13th Gen Intel(R) Core(TM) i9-13900Hreference · measuring tool0.18<0.010.01
NVIDIA GeForce RTX 4060 Laptop GPU · 13th Gen Intel(R) Core(TM) i9-13900Hmeasuring tool · 21 November 20261.11<0.010.01

Bars against one 16.7 ms frame. A browser-tab run is timed in a visible tab without the tool’s scripted input, so read it as close, not exact.

How steadily it runs on RTX 4060 Laptop · 13th Gen Intel(R) Core(TM) i9-13900H · reference

Typical frame ?
16.73 ms
1% low ?
55 fps
Varies by ?
±0.53 ms
All metricsRTX 4060 Laptop · 13th Gen Intel(R) Core(TM) i9-13900H · reference
p50p95p9916.02 ms18.35 ms +
How long each frame took. Most frames sit in the tall bars; a long tail to the right is hitching.

Frames run on a 60 Hz timer (a page demo), so most frames take about one tick, 16.7 ms: the spread around it is what matters.

Frames

Median (p50) ?
16.73 ms
p95 ?
17.91 ms
p99 ?
18.13 ms
Slowest ?
18.50 ms
Mean ?
16.81 ms
Standard deviation ?
0.53 ms
1% low ?
55 fps
0.1% low ?
54 fps
Hitches ?
0 of 600
Over budget ?
0 of 600

Main thread

Long tasks ?
0
Long frames ?
0
Event-loop delay ?
0.1 / 0.3 / 0.5 ms

Input

No input during this run.

Memory

JavaScript heap ?
70.0 → 71.5 MB
Growth ?
+1.52 MB

Browser

JavaScript a frame ?
0.18 ms
All tasks a frame ?
0.53 ms
Layout / style ?
0.00 / 0.00 ms
Main thread busy ?
3%

Garbage collection

Collections ?
1 (1 minor, 0 major)
Pauses ?
2.0 ms in all, longest 0.6
All metricsNVIDIA GeForce RTX 4060 Laptop GPU · 13th Gen Intel(R) Core(TM) i9-13900H · measuring tool
p50p95p9915.94 ms18.15 ms +
How long each frame took. Most frames sit in the tall bars; a long tail to the right is hitching.

Frames run on a 60 Hz timer (a page demo), so most frames take about one tick, 16.7 ms: the spread around it is what matters.

Frames

Median (p50) ?
16.73 ms
p95 ?
17.77 ms
p99 ?
18.07 ms
Slowest ?
18.30 ms
Mean ?
16.81 ms
Standard deviation ?
0.51 ms
1% low ?
55 fps
0.1% low ?
55 fps
Hitches ?
0 of 600
Over budget ?
0 of 600

Main thread

Long tasks ?
0
Long frames ?
0
Event-loop delay ?
0.1 / 0.4 / 1.5 ms

Input

No input during this run.

Memory

JavaScript heap ?
44.9 → 49.2 MB
Growth ?
+4.26 MB

Browser

JavaScript a frame ?
0.25 ms
All tasks a frame ?
0.71 ms
Layout / style ?
0.00 / 0.00 ms
Main thread busy ?
4%

Garbage collection

Collections ?
0 (0 minor, 0 major)
Pauses ?
0.0 ms in all, longest 0.0

What it needs

Renders with
WebGPUNeeds WebGPU: current Chrome and Edge, Safari 26+, Firefox 141+ on Windows.
Your browser
Checking…Looking for WebGPU
Depends on
NothingNo other packages
With an agent
install("hero-family")Your coding agent reads its pitfalls and installs it through the library’s MCP server. Set it up

What it’s for

  1. The opening of a company, product or studio site that should feel made for its own words
  2. A clean, calm hero for finance and reporting sites, with the firm’s figures as cut-paper relief
  3. A liquid-glass hero for a product presentation
  4. A spectacular flock or particle hero for a creative studio or a launch
  5. An ominous title screen for a game
  6. A hero whose heading stands in a running stream that answers the pointer
  7. One hero component that changes character with the site’s look and kind
  8. A hero backdrop shaped by a time series, with the exact values kept for screen readers

Pitfalls, in brief

  1. The scene is built from the element marked data-part="heading": keep it real text in the page (not an image), and give the hero a block size.
  2. Glass draws the letters itself while it is live and makes the heading’s own colour transparent (the text stays selectable and readable by assistive tools).
  3. The words read through a halo, not a box: halo (0 to 1, default 0.6) keeps a clear band round the glyphs in Daylight and Murmuration and deepens the letters’ tint in Glass.
  4. Text over the scene is your page’s text: mark small copy data-part="lede" so every mood goes quiet behind it, and check --text and --text-2 against the picture in both themes.
  5. Call restyle() after changing the look, the theme or the dials: colours and traits are read once, not every frame.
6 more in brief
  1. Liveliness 0 is the slowest, not still: the hero is the one place a quiet look still moves a little.
  2. Stream solves about 70,000 cells of water (36,000 and 20,000 on the lighter tiers) about 440 times a second whatever the refresh rate, so it is the family’s most expensive mood: read gpuTime() at your own hero size.
  3. Murmuration needs compute and a storage buffer of 4 MB; the flock’s size follows the tier (about 216,000, 96,000 or 43,000 on a full-HD hero).
  4. Costs are per frame at the raster the tier allows (not the screen’s pixels), and the high tier draws Daylight 30 times a second and the others 60.
  5. The series is drawn as relative height on a scale that includes zero, from 32 samples.
  6. One mount makes one WebGPU device.
11 pitfalls in full, the hook-up guide, the module source and its tests come with the part.

Where it comes from

Written for the library. Fully custom code.

Hannes Andersson: Feature Library effect and fictional demo.

Pedro Felzenszwalb and Daniel Huttenlocher: The linear-time Euclidean distance transform the heading’s field is built with ("Distance Transforms of Sampled Functions", 2012), written out here from the paper.

herolanding pageheadingdistance fieldtext as scenemoodssoft shadowsliquid glassrefractionflockparticlescomputewatershallow waterstreamfogcreaturedata-shapedlooksdialsreduced motionstill fallbackWebGPUno dependencies

Near it in the frame