Animation primitives for PhiaUI — 22 components covering infinite loops, background effects, text effects, entry/scroll animations, interactive hover, counter animations, decorative borders, CSS loaders, and canvas effects.
All JS-driven components respect prefers-reduced-motion.
Components (A — Infinite Loop)
marquee/1— horizontal/vertical infinite scroll tickerorbit/1— element orbiting a center at configurable radius
Components (B — Background Effects)
aurora/1— animated aurora borealis gradientmeteor_shower/1— falling meteors across a containerdot_pattern/1— radial dot grid backgroundgrid_pattern/1— orthogonal grid lines backgroundripple_bg/1— concentric expanding rings
Components (C — Text Effects)
shimmer_text/1— sliding shine gradient over texttypewriter/1— char-by-char text revealword_rotate/1— cycling words with fadetext_scramble/1— glitch-then-reveal text effect
Components (D — Entry Animations)
Components (E — Interactive Hover)
spotlight/1— cursor-following radial lighttilt_card/1— 3D perspective tilt on hover
Components (F — Counter)
number_ticker/1— count-up animation to target value
Components (G — Decorative)
animated_border/1— rotating conic-gradient borderpulse_ring/1— expanding pulsing rings
Components (H — Loaders)
typing_indicator/1— 3-dot bouncing chat loaderwave_loader/1— wave bar equalizer loader
Components (I — Canvas Effects)
confetti_burst/1— canvas confetti particlesparticle_bg/1— canvas floating particle field
Summary
Functions
Rotating conic-gradient animated border wrapper. Pure CSS.
Aurora borealis animated gradient background. Pure CSS.
Canvas confetti particle burst.
Requires PhiaConfetti JS hook.
Radial dot grid background pattern. Pure CSS.
Wraps content with a scroll-triggered reveal animation.
Requires PhiaScrollReveal JS hook.
Perpetual floating/levitation loop. Pure CSS @keyframes float.
Orthogonal grid lines background. Pure CSS.
Infinite scroll marquee. Renders slot content twice for a seamless loop.
Requires PhiaMarquee JS hook.
Randomly-positioned falling meteors. Pure CSS @keyframes meteor.
Counts up from 0 to value with easeOutCubic easing.
Requires PhiaNumberTicker JS hook.
Element orbiting a center point. Pure CSS @keyframes orbit.
Canvas floating particle field background.
Requires PhiaParticleBg JS hook.
Expanding pulsing rings radiating from a center element. Pure CSS.
Concentric expanding rings ripple from center. Pure CSS.
Inline text with a sliding shine gradient over the surface. Pure CSS.
Radial gradient spotlight that follows the cursor inside the container.
Requires PhiaSpotlight JS hook.
Scrambles then reveals text with a glitch effect.
Requires PhiaTextScramble JS hook.
3D perspective tilt card on mouse hover.
Requires PhiaTiltCard JS hook.
Types text char-by-char with an optional cursor blink.
Requires PhiaTypewriter JS hook.
Three-dot bouncing chat typing indicator. Pure CSS.
Wave equalizer bar loader. Pure CSS.
Cycles through a list of words with a fade/slide transition.
Requires PhiaWordRotate JS hook.
Functions
Rotating conic-gradient animated border wrapper. Pure CSS.
Examples
<.animated_border colors={["#ff0080", "#7928ca"]} speed={3} class="p-4">
<p>Fancy border!</p>
</.animated_border>Attributes
colors(:list) - Color stops for the rotating conic gradient. Defaults to["#ff0080", "#ff8c00", "#40e0d0"].speed(:integer) - Rotation duration in seconds. Defaults to4.border_width(:integer) - Border width in pixels. Defaults to2.radius(:string) - Tailwind border-radius class. Defaults to"rounded-lg".class(:string) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)
Aurora borealis animated gradient background. Pure CSS.
Examples
<.aurora colors={["#00d2ff", "#7928ca"]} speed={6} class="h-64 w-full rounded-xl" />Attributes
colors(:list) - Color stops for the aurora gradient. Defaults to["#00d2ff", "#3a47d5", "#a8edea", "#fed6e3"].speed(:integer) - Animation duration in seconds. Defaults to8.class(:string) - Defaults tonil.- Global attributes are accepted.
Canvas confetti particle burst.
Requires PhiaConfetti JS hook.
Examples
<.confetti_burst trigger={:click} count={120} class="absolute inset-0">
<button phx-click="celebrate">🎉 Celebrate!</button>
</.confetti_burst>Attributes
trigger(:atom) - What triggers the confetti burst. Defaults to:mount. Must be one of:mount, or:click.count(:integer) - Number of confetti particles. Defaults to80.colors(:list) - Particle color palette. Defaults to["#ff0000", "#00ff00", "#0000ff", "#ffff00", "#ff00ff", "#00ffff"].class(:string) - Defaults tonil.- Global attributes are accepted.
Radial dot grid background pattern. Pure CSS.
Examples
<.dot_pattern color="oklch(0.5 0 0 / 20%)" spacing={20} class="absolute inset-0" />Attributes
color(:string) - Dot color (any CSS value). Defaults to"currentColor".size(:integer) - Dot radius in pixels. Defaults to1.spacing(:integer) - Grid cell size in pixels. Defaults to24.class(:string) - Defaults tonil.- Global attributes are accepted.
Wraps content with a scroll-triggered reveal animation.
Requires PhiaScrollReveal JS hook.
Examples
<.fade_in direction={:up} delay={200}>
<p>Appears from below on scroll.</p>
</.fade_in>Attributes
direction(:atom) - Entry direction for the slide animation. Defaults to:up. Must be one of:up,:down,:left,:right, or:none.delay(:integer) - Transition delay in milliseconds. Defaults to0.duration(:integer) - Transition duration in milliseconds. Defaults to500.once(:boolean) - Reveal only once (no re-hide). Defaults totrue.threshold(:float) - IntersectionObserver threshold. Defaults to0.1.class(:string) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)
Perpetual floating/levitation loop. Pure CSS @keyframes float.
Examples
<.float amplitude={:lg} duration={4}>
<img src="/hero-icon.svg" class="size-16" />
</.float>Attributes
amplitude(:atom) - Float movement amplitude. Defaults to:md. Must be one of:sm,:md, or:lg.duration(:integer) - Float cycle duration in seconds. Defaults to3.class(:string) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)
Orthogonal grid lines background. Pure CSS.
Examples
<.grid_pattern color="oklch(0.5 0 0 / 15%)" size={40} class="absolute inset-0" />Attributes
color(:string) - Grid line color. Defaults to"currentColor".size(:integer) - Grid cell size in pixels. Defaults to32.class(:string) - Defaults tonil.- Global attributes are accepted.
Infinite scroll marquee. Renders slot content twice for a seamless loop.
Requires PhiaMarquee JS hook.
Examples
<.marquee gap="gap-8">
<img src="/logo1.png" />
<img src="/logo2.png" />
</.marquee>
<.marquee direction={:vertical} speed={20} pause_on_hover={false}>
<div>Item 1</div>
</.marquee>Attributes
direction(:atom) - Scroll direction. Defaults to:horizontal. Must be one of:horizontal, or:vertical.speed(:integer) - Animation duration in seconds. Defaults to40.pause_on_hover(:boolean) - Pause animation on mouse enter. Defaults totrue.reverse(:boolean) - Reverse scroll direction. Defaults tofalse.gap(:string) - Tailwind gap class between items. Defaults to"gap-4".class(:string) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)
Randomly-positioned falling meteors. Pure CSS @keyframes meteor.
Examples
<.meteor_shower count={15} class="absolute inset-0" />Attributes
count(:integer) - Number of meteors. Defaults to20.color(:string) - Meteor trail color. Defaults to"#94a3b8".class(:string) - Defaults tonil.- Global attributes are accepted.
Counts up from 0 to value with easeOutCubic easing.
Requires PhiaNumberTicker JS hook.
Examples
<.number_ticker value={1248} format={:comma} prefix="$" class="text-4xl font-bold" />
<.number_ticker value={98} format={:percent} suffix="%" duration={2000} />Attributes
value(:integer) (required) - Target value to count up to.duration(:integer) - Animation duration in milliseconds. Defaults to1500.format(:atom) - Number formatting style. Defaults to:plain. Must be one of:plain,:comma, or:percent.prefix(:string) - Text before the number (e.g. "$"). Defaults to"".suffix(:string) - Text after the number (e.g. "K"). Defaults to"".decimal_places(:integer) - Defaults to0.class(:string) - Defaults tonil.- Global attributes are accepted.
Element orbiting a center point. Pure CSS @keyframes orbit.
Examples
<.orbit radius={80} duration={8}>
<span class="size-3 rounded-full bg-primary" />
<:center>
<img src="/logo.svg" class="size-10" />
</:center>
</.orbit>Attributes
radius(:integer) - Orbit radius in pixels. Defaults to60.duration(:integer) - Orbit duration in seconds. Defaults to10.delay(:integer) - Animation delay in milliseconds. Defaults to0.reverse(:boolean) - Reverse orbit direction. Defaults tofalse.class(:string) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)center- Content placed at the orbit center.
Canvas floating particle field background.
Requires PhiaParticleBg JS hook.
Examples
<.particle_bg count={80} color="rgba(99,102,241,0.6)" connect={true} class="h-screen w-full" />Attributes
count(:integer) - Number of floating particles. Defaults to50.color(:string) - Particle and line color. Defaults to"rgba(148,163,184,0.8)".speed(:float) - Base particle movement speed. Defaults to0.5.connect(:boolean) - Draw connecting lines between nearby particles. Defaults totrue.class(:string) - Defaults tonil.- Global attributes are accepted.
Expanding pulsing rings radiating from a center element. Pure CSS.
Examples
<.pulse_ring color="oklch(0.6 0.2 250)" size={40}>
<span class="size-4 rounded-full bg-primary" />
</.pulse_ring>Attributes
color(:string) - Ring color. Defaults to"var(--color-primary)".size(:integer) - Base ring size in pixels. Defaults to48.duration(:integer) - Pulse duration in seconds. Defaults to2.count(:integer) - Number of pulsing rings. Defaults to3.class(:string) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block
Concentric expanding rings ripple from center. Pure CSS.
Examples
<.ripple_bg color="oklch(0.6 0.2 250)" count={4} class="size-40" />Attributes
color(:string) - Ring color. Defaults to"var(--color-primary)".duration(:integer) - Ripple cycle duration in seconds. Defaults to2.count(:integer) - Number of concentric rings. Defaults to3.class(:string) - Defaults tonil.- Global attributes are accepted.
Inline text with a sliding shine gradient over the surface. Pure CSS.
Examples
<.shimmer_text class="text-2xl font-semibold">✨ Magic UI</.shimmer_text>Attributes
speed(:integer) - Shimmer cycle duration in seconds. Defaults to8.class(:string) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)
Radial gradient spotlight that follows the cursor inside the container.
Requires PhiaSpotlight JS hook.
Examples
<.spotlight class="p-8 rounded-xl border" color="rgba(120,80,255,0.2)" size={400}>
<h2>Hover me!</h2>
</.spotlight>Attributes
color(:string) - Spotlight color (any CSS color). Defaults to"rgba(255,255,255,0.15)".size(:integer) - Spotlight radius in pixels. Defaults to300.class(:string) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)
Scrambles then reveals text with a glitch effect.
Requires PhiaTextScramble JS hook.
Examples
<.text_scramble text="Decode me" trigger={:hover} />
<.text_scramble text="Hello World" trigger={:click} duration={1200} />Attributes
text(:string) (required) - Target text to reveal.trigger(:atom) - What triggers the scramble effect. Defaults to:mount. Must be one of:mount,:hover, or:click.duration(:integer) - Scramble duration in milliseconds. Defaults to800.class(:string) - Defaults tonil.- Global attributes are accepted.
3D perspective tilt card on mouse hover.
Requires PhiaTiltCard JS hook.
Examples
<.tilt_card max_tilt={20} glare={true} class="rounded-xl border p-6">
<h3>Hover to tilt</h3>
</.tilt_card>Attributes
max_tilt(:integer) - Maximum tilt angle in degrees. Defaults to15.scale(:float) - Scale factor on hover. Defaults to1.05.glare(:boolean) - Show glare overlay effect. Defaults tofalse.class(:string) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)
Types text char-by-char with an optional cursor blink.
Requires PhiaTypewriter JS hook.
Examples
<.typewriter text="Hello, PhiaUI!" speed={60} cursor={true} loop={true} />Attributes
text(:string) (required) - The text to type out.speed(:integer) - Milliseconds per character. Defaults to80.cursor(:boolean) - Show blinking cursor. Defaults totrue.loop(:boolean) - Restart after completion. Defaults tofalse.delay(:integer) - Initial delay in milliseconds. Defaults to0.class(:string) - Defaults tonil.- Global attributes are accepted.
Three-dot bouncing chat typing indicator. Pure CSS.
Examples
<.typing_indicator color="var(--color-primary)" size={:lg} />Attributes
color(:string) - Dot color. Defaults to"var(--color-muted-foreground)".size(:atom) - Defaults to:md. Must be one of:sm,:md, or:lg.class(:string) - Defaults tonil.- Global attributes are accepted.
Wave equalizer bar loader. Pure CSS.
Examples
<.wave_loader color="oklch(0.6 0.2 250)" size={:lg} bar_count={7} />Attributes
color(:string) - Bar color. Defaults to"var(--color-primary)".size(:atom) - Defaults to:md. Must be one of:sm,:md, or:lg.bar_count(:integer) - Number of bars. Defaults to5.class(:string) - Defaults tonil.- Global attributes are accepted.
Cycles through a list of words with a fade/slide transition.
Requires PhiaWordRotate JS hook.
Examples
<.word_rotate words={["Fast", "Beautiful", "Accessible"]} duration={2000} />Attributes
words(:list) (required) - List of words to cycle through.duration(:integer) - Time per word in milliseconds. Defaults to2500.class(:string) - Defaults tonil.- Global attributes are accepted.