axi0motion

Split text

Words, or letters, rise into place one after another the first time the text scrolls into view.

  • enhancer
  • entrance
  • scroll
  • words
  • letters
  • since 0.1

Background Studio: tune it below, then copy the code

Your system asks for reduced motion: the demo shows its final state and nothing moves.

Live demo

Split text example

Words rise into place, one after another.

Controls

0 ms
650 ms
0 ms

Code

It follows the controls above: change an option and the code changes with it.

<link rel="stylesheet" href="/axi0/motion/motion.css?v=6">
<script src="/axi0/motion/motion.js?v=10" defer></script>

<p class="demo-big" data-motion="split-text">Words rise into place, one after another.</p>

The wrappers: SplitText.tsx (React, TypeScript) and SplitText.vue (Vue). Both render the same attributes as the HTML; the loader does the rest.

Options

AttributeDefaultWhat it does
data-motion-splitwordswords or chars (letters)
data-motion-frombelowwhere each piece comes from
data-motion-stagger0milliseconds between pieces; 0 picks 70 for words, 28 for letters
data-motion-duration650milliseconds per piece
data-motion-delay0milliseconds before the first piece

Accessibility

Text already on screen at load stays as it is. Links and other markup inside are kept; with chars on plain text, screen readers hear one copy of the sentence. In React, put it on an element whose text does not change after mount (or give it a key so a change remounts it).

Size

split-text.js is 1.3 KB gzip. A page loads the loader (2.7 KB) and core.js (1.4 KB) once, whatever it uses.