Components Text Animation

Petal Pro is the full SaaS app this is built for

Auth, billing, admin, and Claude Code integration included. One purchase, unlimited projects.

Text Animation

Animated text effects for hero sections and landing pages. Gradient and shimmer are pure CSS. Word rotate and the typing effect use small JS hooks but render their full text server-side, so they still work without JavaScript and search engines see real text.
Gradient text

Text filled with a gradient that sweeps from end to end. Pure CSS, no hook required. Set the font size and weight with the class attr.

Build Phoenix apps faster
heex

Change the colors with color_from and color_to, and the sweep time with duration.

From idea to production
heex
Shimmer text

Muted text with a band of light passing over it, the classic "✨ Introducing ..." pill treatment. Pure CSS. Control the speed with duration.

✨ Introducing Petal Components v4
heex
Word rotate

Cycles through a list of words with a smooth roll-up transition. Requires the PetalWordRotate hook from the petal_components JS bundle, and the id attr is required. The first word is rendered server-side, so there's no layout jump and crawlers see a complete sentence.

Petal makes your app beautiful.
heex
Typing effect

Types text out character by character with a blinking caret. Requires the PetalTypingEffect hook from the petal_components JS bundle, and the id attr is required. The full text is rendered server-side and replayed on mount, so it reads fine without JavaScript and stays visible to search engines. Set loop to delete and retype forever.

shadcn for Phoenix
heex
Properties
<.gradient_text>
Attribute Type Default Description
class any nil extra classes (set font size/weight here)
color_from string "#ffaa40" start color of the gradient
color_to string "#9c40ff" end color of the gradient
duration string "8s" time for one full gradient sweep
rest global
:inner_block slot slot
<.shimmer_text>
Attribute Type Default Description
class any nil extra classes (set font size/weight here)
duration string "2.5s" time for one full shimmer pass
rest global
:inner_block slot slot
<.typing_effect>
Attribute Type Default Description
class any nil extra classes (set font size/weight here)
cursor boolean true show a blinking caret
id* string
loop boolean false delete the text and type it again, forever
rest global
speed integer 60 milliseconds per character
start_delay integer 0 milliseconds to wait before typing starts
text* string the text to type out
<.word_rotate>
Attribute Type Default Description
class any nil extra classes (set font size/weight here)
id* string
interval integer 2500 milliseconds each word stays on screen
rest global
words* list the words to cycle through