Slice it.
Stagger it.
SplitText is free.
A total rewrite of the classic text-splitting plugin—now half the size with 14+ new features.
Read the docs →let splitText = SplitText.create(text, {
type: "lines",
mask: "lines",
autoSplit: true,
onSplit: (self) => {
return gsap.from(self.lines, {
yPercent: 100,
stagger: 0.25,
opacity: 1,
repeat: -1,
repeatDelay: 0.5,
yoyo: true,
});
},
});
The new SplitText is half the size and packed with 14+ new features. deepSlice handles nested tags like <span> and <strong> without breaking a sweat. Wanna preserve your <a> tags and throw some emoji in there 🤘💚🥳? It’s built for that. Smash lines. Bold everything. GO WILD!