ef-text

Attributes

split
string

Split mode

Default:word
Values:linewordchar
stagger
timestring

Delay between segments (e.g., "100ms")

easing
string

Easing function

Default:linear
duration
timestring

Total duration

Animated text with character/word/line splitting.

Basic Usage

Live
Static text

Word Split with Stagger

Use split="word" to animate each word independently with stagger delays.

Live
Each word appears with timing

Character-by-Character Animation

Use split="char" for character-level effects.

Live
HEADLINES

Line-by-Line Reveal

Use split="line" for line-based animations.

Live
First line appears Then the second line Finally the third line

Custom Animations with registerAnimations()

Use registerAnimations() to define reusable animation styles globally.

Live
BOUNCE EFFECT

Easing Options

Different easing functions create different animation feels.

Live
Linear easing (constant speed) Ease-out (starts fast ends slow) Custom cubic-bezier (bouncy)

StaggerMs Timing Variations

Control the delay between segments to create different rhythms.

Live
Fast stagger feels energetic Medium stagger is balanced Slow stagger adds drama

Using --ef-seed for Random Variation

The --ef-seed CSS variable provides deterministic randomness per segment.

Live
Words slide from random angles

Lower Third

Live
Scene Label

Multiple Segments Per Word

Create multiple segments for each text unit by using multiple ef-text-segment elements in the template.

Live
Layered shadow effect

Unregistering Animations

Remove previously registered animations when no longer needed.

const EFTextSegment = customElements.get('ef-text-segment');
EFTextSegment.unregisterAnimations('bounce');

ef-text-segment Reference

ef-text-segment elements are automatically created by ef-text when using split modes. Each segment represents a word, character, or line and can be styled and animated independently.

CSS Variables

VariableTypeDescription
--ef-indexnumberSegment index (0, 1, 2, ...)
--ef-stagger-offsettimeCalculated stagger delay (e.g., "0ms", "100ms")
--ef-seednumberDeterministic random (0-1) based on index

Technical Notes

  • Segments are automatically created by ef-text when using split modes
  • Segments inherit animation properties from parent ef-text element
  • registerAnimations() uses adopted stylesheets for efficient global sharing
  • Non-whitespace segments automatically become inline-block when animated to enable transforms
  • Whitespace segments remain inline to preserve text flow