motion-headline
Wraps each word, character, or line in an overflow-hidden mask and springs them into view. A Locomotive-style reveal built on Motion. Fully accessible via a visually hidden copy of the text.
Preview
Import
import 'motion-components/motion-headline' // just this one
import 'motion-components' // or the whole libraryUsage
<motion-headline by="words" interval="0.06" duration="1">
Craft award-winning motion
</motion-headline>by="chars"
Split into characters for a more expressive per-letter mask reveal.
<motion-headline by="chars" interval="0.04" duration="0.9">
Motion
</motion-headline>by="lines"
Groups words into detected layout lines using getBoundingClientRect, then reveals each line as a unit. Ideal for multi-line hero headings.
<motion-headline by="lines" interval="0.12" duration="1.1">
Craft motion that earns attention
</motion-headline>variant="flip"
Each unit starts rotated 90° around the X axis and springs forward into place, like a 3D card flip. Works with
<motion-headline variant="flip" by="words" interval="0.07" duration="0.9">
Flip into view
</motion-headline>delay
<motion-headline by="words" interval="0.08" duration="1" delay="0.3">
Motion that feels alive
</motion-headline>Loop
Add loop to reveal the headline, hold, hide it and reveal again. hold sets how long it
stays visible, gap how long it stays hidden.
<motion-headline by="words" interval="0.08" duration="0.9" loop hold="1.4" gap="0.5">
Motion that feels alive
</motion-headline>
The cycle runs only while the headline is on screen, and once is ignored. Add
pause-on-hover to freeze it while the pointer is over the headline.
Properties
| Attribute | Property | Type | Default | Description |
|---|---|---|---|---|
| | | string | 'words' | |
| | | string | 'slide' | |
| | | number | 0.06 | Stagger delay between each unit in seconds |
| | | number | 1 | Spring duration hint in seconds |
| | | number | 0 | Initial delay before the stagger begins, in seconds |
| | | number | 0.2 | IntersectionObserver threshold (0–1) that triggers the reveal |
| | | boolean | true | When |
| | | boolean | false | Reveal, hold, hide and reveal again on repeat. The cycle runs while the headline is on screen |
| | | number | 1.6 | With |
| | | number | 0.5 | With |
| | | boolean | false | Pause the loop while the pointer is over the headline, resuming on leave |
JavaScript API
Trigger the headline programmatically with play() and cancel().
Accessibility
Keeps the full original text in a visually hidden span and sets aria-hidden="true" on the split spans.
Screen readers receive the complete phrase without interruption by individual letter spans.
Respects prefers-reduced-motion: content snaps to its final visible state with no animation.