Text Effect
betaText that animates in by character, word or line — blur, rise, mask, spring, centre-out, phrase builds and a wave, as 19 presets.
- Effects & motion
- 2 files
- 1 npm package
- Accessibility notes
pnpm dlx @dowel-ui/cli add text-effectnpm packages installed: class-variance-authority.
import { TextEffect } from "@/components/ui/text-effect";Default
Gallery
Split Units
In View
Exit
Right To Left
<TextEffect>
| Prop | Type | Default |
|---|---|---|
children (required)The text. A string, because it is split; use | string | — |
amplitudewave-text only: peak height of the wave, in pixels. | number | 8 |
asThe element to render. Headings keep their role and read as one string. | TextEffectElement | "span" |
bySplit unit. Defaults to the source's. The phrase builders (kinetic-center-build, short-slide-down, short-slide-right) are always per word: their layout is the effect. Prefer | TextEffectUnit | — |
delayMilliseconds before the first piece moves. | number | 0 |
directionreveal-text only: the way the text travels as it appears. | TextEffectDirection | "up" |
durationMilliseconds each piece takes to enter (or one wave cycle). Defaults to the preset's. | number | — |
mode
| "enter" | "exit" | "enter" |
onCompleteCalled once the last piece settles. Never called for wave-text. | () => void | — |
presetWhich SmoothUI animation to play. | TextEffectPreset | "soft-blur-in" |
ref | Ref<HTMLElement> | — |
replayKeyChange it to replay. Changing | Key | — |
staggerMilliseconds between pieces. Defaults to the preset's. | number | — |
trigger
| "mount" | "in-view" | "mount" |
Plus every attribute of <span> except children, ref, preset, by.
7/7
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — does not apply
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — does not apply
- className merged — passes
- Visible focus — does not apply
- No fixed widths — passes