data-effect

Unified declarative visual effects via the data-effect attribute. Text styling, motion, backgrounds, and display effects.

Unified Effect System

The data-effect attribute is the single entry point for all visual effects in Vanilla Breeze. Instead of separate data-blink, data-glitch, data-shimmer attributes, every effect is activated through one unified attribute.

<h1 data-effect="glitch">Glitchy Heading</h1> <p data-effect="reveal" data-trigger="scroll">Revealed on scroll</p> <span data-effect="shimmer" class="slow">Slow shimmer</span>

How it works

ConceptAttribute / MechanismExample
Effect namedata-effect="name"data-effect="glitch"
Activation triggerdata-triggerdata-trigger="scroll", data-trigger="hover"
Variants & modifiersclassclass="slow", class="line", class="red animate"
Fine-tuningCSS custom properties via stylestyle="--vb-reveal-delay: 120ms"

Multiple effects

Apply multiple effects to a single element with space-separated values:

<h1 data-effect="gradient-text shimmer">Gradient + Shimmer</h1>

data-effect="blur-reveal" effects

Words start blurred and transition to clear instead of sliding up. Creates a dreamy, focus-pull effect. Triggers on scroll.

<h1 data-effect="blur-reveal" data-trigger="scroll">Text emerges from a soft blur</h1> <h2 data-effect="blur-reveal" data-trigger="scroll" style="--vb-blur-reveal-delay: 120ms">Slower blur-to-clear transition</h2> <p data-effect="blur-reveal" data-trigger="scroll" class="line">Line-by-line blur reveal creates a dreamy effect.</p>
Attribute / ClassValuesDescription
data-effect="blur-reveal"Enables the blur reveal effect. Use with data-trigger="scroll".
class="word"Word-by-word split mode (default).
class="line"Line-by-line split mode.
CSS PropertyDefaultDescription
--vb-blur-reveal-delay80msStagger delay between chunks.

data-effect="bounce"

Continuous vertical bounce animation. The element bounces up and down in a rhythmic loop. The kawaii pack overrides this with a spring-loaded hover-only variant when loaded.

<button data-effect="bounce">Bouncing Button</button> <span data-effect="bounce" class="slow">Slow bounce</span> <span data-effect="bounce" style="--vb-bounce-height: 20px; display: inline-block;">Big bounce</span>
Attribute / ClassValuesDescription
data-effect="bounce"Enables the bounce animation (continuous loop).
class="slow"Slower bounce cycle.
class="fast"Faster bounce cycle.
CSS PropertyDefaultDescription
--vb-bounce-height12pxMaximum bounce height.
--vb-duration1sDuration of one bounce cycle.

data-effect="collapse"

Height-to-zero exit animation. The element collapses vertically while fading out, then stays hidden. Useful for dismissible alerts, list item removal, or accordion-style closing.

<p data-effect="collapse" data-trigger="click">Click this paragraph to collapse it.</p> <p data-effect="collapse" data-trigger="time:4000">This collapses after 4 seconds.</p>
Attribute / ClassValuesDescription
data-effect="collapse"Enables the collapse exit effect. Activates when data-effect-active is set.
data-trigger="click"Collapse on click.
data-trigger="time:n"Collapse after n milliseconds.
class="slow"Slower collapse duration.
CSS PropertyDefaultDescription
--vb-collapse-height500pxStarting max-height. Set to the element's natural height for a smoother animation.
--vb-duration300msDuration of the collapse animation.

data-effect="fade-in"

Simple opacity fade entrance. Element transitions from transparent to fully visible. Commonly used with data-trigger="scroll" for scroll-triggered reveals.

<h1 data-effect="fade-in" data-trigger="scroll">Fades in on scroll</h1> <p data-effect="fade-in" data-trigger="scroll" class="slow">Slow fade entrance</p>
Attribute / ClassValuesDescription
data-effect="fade-in"Enables the fade-in effect. Use with data-trigger="scroll".
class="slow"Slower fade duration.
class="fast"Faster fade duration.
CSS PropertyDefaultDescription
--vb-fade-in-duration0.6sDuration of the fade animation.

data-effect="fade-out"

Opacity fade exit. Element transitions from visible to transparent. Use with data-trigger="click" or data-trigger="time:n".

<p data-effect="fade-out" data-trigger="scroll">Fades out as you scroll past</p>
Attribute / ClassValuesDescription
data-effect="fade-out"Enables the fade-out effect. Use with data-trigger="scroll".
CSS PropertyDefaultDescription
--vb-fade-out-duration0.6sDuration of the fade-out animation.

data-effect="flipboard" retro

Split-flap departure board effect. Each character sits in a dark cell with a horizontal hinge and cycles through random letters before settling on the target. Requires JS.

<p data-effect="flipboard">DEPARTURES</p> <p data-effect="flipboard">GATE 42</p> <p data-effect="flipboard">ON TIME</p>
Attribute / ClassValuesDescription
data-effect="flipboard"Enables the split-flap effect on the element's text content.
CSS PropertyDefaultDescription
--vb-flip-ms60msDuration of each character flip animation.

data-effect="float"

Gentle vertical floating animation. The element bobs up and down in a smooth loop, creating a weightless or hovering appearance.

<span data-effect="float">Floating element</span> <span data-effect="float" class="slow">Slow float</span>
Attribute / ClassValuesDescription
data-effect="float"Enables the floating animation.
class="slow"Slower float cycle.
class="fast"Faster float cycle.
CSS PropertyDefaultDescription
--vb-float-duration3sDuration of one float cycle.
--vb-float-distance10pxVertical distance of the float movement.

data-effect="glitch" effects

Chromatic aberration glitch with cyan/red channel splitting via CSS pseudo-elements. Tiny JS sets a data-glitch-text attribute for the pseudo-element content.

<h1 data-effect="glitch">System Error</h1> <h2 data-effect="glitch" data-trigger="hover">Hover Me for Glitch</h2>
Attribute / ClassValuesDescription
data-effect="glitch"Enables the glitch effect (always-on by default).
data-trigger="hover"Glitch only on hover.

data-effect="gradient-text"

CSS-only gradient coloring with theme-aware defaults and preset palettes. Add class="animate" for a flowing animation.

<h1 data-effect="gradient-text">Beautiful Gradient Text</h1> <h2 data-effect="gradient-text" class="sunset">Warm Sunset Gradient</h2> <h2 data-effect="gradient-text" class="ocean">Cool Ocean Gradient</h2> <h2 data-effect="gradient-text" class="forest">Deep Forest Gradient</h2> <h2 data-effect="gradient-text" class="neon">Electric Neon Gradient</h2> <h1 data-effect="gradient-text" class="animate">Flowing Gradient Animation</h1>
Attribute / ClassValuesDescription
data-effect="gradient-text"Enables gradient text. Empty uses theme primary→secondary.
class="sunset"Warm sunset gradient palette.
class="ocean"Cool ocean gradient palette.
class="forest"Deep forest gradient palette.
class="neon"Electric neon gradient palette.
class="animate"Enable flowing gradient animation.

data-effect="glow"

Pulsing drop-shadow glow that alternates between a subtle and intense luminance. Uses filter: drop-shadow() with color-mix() for smooth color transitions. Defaults to the theme's primary color.

<h2 data-effect="glow">Glowing text</h2> <h2 data-effect="glow" style="--vb-glow-color: oklch(65% 0.28 25);">Red glow</h2> <button data-effect="glow">Attention needed</button>
Attribute / ClassValuesDescription
data-effect="glow"Enables the pulsing glow animation (2s default cycle).
class="slow"Slower glow pulse.
class="fast"Faster glow pulse.
CSS PropertyDefaultDescription
--vb-glow-colorvar(--color-primary)Glow color. Any CSS color value.
--vb-duration2sDuration of one glow pulse cycle.

data-effect="hard-shadow" retro

Hard-edged offset text shadows with no blur. Choose single, double, or long trailing shadows with optional color presets. Sets font-weight: 900.

<h1 data-effect="hard-shadow">Hard Shadow</h1> <h2 data-effect="hard-shadow" class="double">Double Shadow</h2> <h2 data-effect="hard-shadow" class="long">Long Shadow</h2> <h2 data-effect="hard-shadow" class="long red">Long Red</h2>
Attribute / ClassValuesDescription
data-effect="hard-shadow"Enables the hard shadow effect (single shadow default).
class="double"Double shadow style.
class="long"Long trailing shadow style.
class="red", "blue", "gold", "green"Shadow color preset. Combine with style classes.
CSS PropertyDefaultDescription
--vb-shadow-coloroklch(20% 0 0)Shadow color.
--vb-shadow-offset3pxBase shadow offset distance.

data-effect="highlight"

Animated underline, box fill, or circle highlight that draws in when scrolled into view.

<p>This text has an <span data-effect="highlight" data-trigger="scroll">animated underline</span> that draws in on scroll.</p> <p>Highlight <mark data-effect="highlight" data-trigger="scroll" class="box">important phrases</mark> with a background fill.</p> <p>Draw attention to <span data-effect="highlight" data-trigger="scroll" class="circle">key words</span> with a circle.</p>
Attribute / ClassValuesDescription
data-effect="highlight"Enables the highlight effect. Use with data-trigger="scroll". Default style is underline.
class="underline"Underline highlight style (default).
class="box"Background fill highlight style.
class="circle"Circle highlight style.
CSS PropertyDefaultDescription
--vb-highlight-colorcurrentColorOverride the highlight color.

data-effect="marquee" retro

Continuously scrolling horizontal content with edge masking. Children animate left (or right with class="reverse") in an infinite loop.

<div data-effect="marquee"> <span>Breaking News</span> <span>Latest Headlines</span> <span>Stay Tuned</span> <span>More Updates</span> </div>
Attribute / ClassValuesDescription
data-effect="marquee"Enables the marquee scroll effect.
class="reverse"Scroll direction reversed (right-to-left becomes left-to-right).
class="slow"Slow scroll speed (40s cycle).
class="fast"Fast scroll speed (8s cycle).
class="pause"Paused state.
class="hover-pause"Pause animation on hover.
CSS PropertyDefaultDescription
--vb-marquee-speed20sScroll animation duration.
--vb-marquee-gapvar(--size-xl, 3rem)Gap between repeating items.

data-effect="neon" retro

Glowing neon text with a pulsing text-shadow halo that breathes in and out over 2.5 seconds.

<h2 data-effect="neon">Neon Glow</h2> <h2 data-effect="neon" class="pink">Pink Neon</h2> <h2 data-effect="neon" class="cyan">Cyan Neon</h2>
Attribute / ClassValuesDescription
data-effect="neon"Enables the neon glow effect. Empty uses theme primary.
class="pink"Pink neon color.
class="cyan"Cyan neon color.
class="green"Green neon color.
class="amber"Amber neon color.
class="red"Red neon color.
CSS PropertyDefaultDescription
--vb-neon-colorPer presetThe glow color in OKLCH.
--vb-neon-spread0.04emGlow blur radius.

data-effect="outline" retro

Hollow outlined text with transparent fill using -webkit-text-stroke. Gracefully skipped via @supports.

<h1 data-effect="outline">Outline Text</h1> <h2 data-effect="outline" class="thick">Thick Outline</h2> <h2 data-effect="outline" class="glow">Glowing Outline</h2>
Attribute / ClassValuesDescription
data-effect="outline"Enables the outline text effect (1px default).
class="thick"Thick stroke (2px).
class="ultra"Ultra thick stroke (3px).
class="glow"Glowing outline mode.
CSS PropertyDefaultDescription
--vb-outline-width1pxStroke width.
--vb-outline-colorvar(--color-text)Stroke color.

data-effect="particles" kawaii

JS-driven floating particle effect. Spawns emoji characters (✦ ✧ ⋆ ♡ ☆) that float upward and fade out. Requires JS.

<section data-effect="particles"> <p>Floating sparkle particles rise from the bottom.</p> </section>
Attribute / ClassValuesDescription
data-effect="particles"Enables floating particle spawning.

data-effect="pop"

Quick scale-up pop animation. The element rapidly scales from small to full size with a slight overshoot, creating a punchy entrance or interaction response.

<button data-effect="pop" data-trigger="hover">Pop on hover</button> <span data-effect="pop" data-trigger="scroll">Pop on scroll</span>
Attribute / ClassValuesDescription
data-effect="pop"Enables the pop effect.
data-trigger="hover"Pop on hover.
data-trigger="scroll"Pop when scrolled into view.
CSS PropertyDefaultDescription
--vb-pop-scale1.15Maximum scale overshoot.
--vb-pop-duration0.3sDuration of the pop animation.

data-effect="pulse"

Rhythmic scale pulse that grows and shrinks in a continuous loop. Useful for drawing attention to call-to-action elements.

<span data-effect="pulse">Pulsing element</span> <span data-effect="pulse" class="slow">Slow pulse</span> <span data-effect="pulse" class="fast">Fast pulse</span>
Attribute / ClassValuesDescription
data-effect="pulse"Enables the pulse animation (2s default cycle).
class="slow"Slow pulse (3s cycle).
class="fast"Fast pulse (1s cycle).
CSS PropertyDefaultDescription
--vb-pulse-duration2sDuration of one pulse cycle.
--vb-pulse-scale1.05Maximum scale of the pulse.

data-effect="rainbow" retro

Continuous hue-rotation filter that cycles through the full color spectrum.

<h1 data-effect="rainbow">Rainbow Cycling</h1> <h2 data-effect="rainbow" class="slow">Slow Rainbow</h2> <h2 data-effect="rainbow" class="fast">Fast Rainbow</h2>
Attribute / ClassValuesDescription
data-effect="rainbow"Enables rainbow cycling (4s default).
class="slow"Slow cycle (8s).
class="fast"Fast cycle (1.5s).
CSS PropertyDefaultDescription
--vb-rainbow-speed4sDuration of one full hue cycle.

data-effect="reveal"

Word-by-word or line-by-line entrance animation. Text slides up and fades in with staggered timing when scrolled into view.

<h1 data-effect="reveal" data-trigger="scroll">Welcome to the future of text animation</h1> <h2 data-effect="reveal" data-trigger="scroll" style="--vb-reveal-delay: 120ms">Each word appears with a longer pause</h2> <p data-effect="reveal" data-trigger="scroll" class="line">Line-by-line reveal guides the eye down the page.</p>
Attribute / ClassValuesDescription
data-effect="reveal"Enables the reveal effect. Use with data-trigger="scroll".
class="word"Word-by-word split mode (default).
class="line"Line-by-line split mode.
CSS PropertyDefaultDescription
--vb-reveal-delay80msStagger delay between chunks.
--vb-reveal-duration400msAnimation duration per chunk.

data-effect="scramble" effects

Characters resolve left-to-right from random symbols. Think Hollywood decryption or sci-fi terminal output. Triggers on scroll.

<h1 data-effect="scramble" data-trigger="scroll">Decoding the future</h1> <h2 data-effect="scramble" data-trigger="scroll" style="--vb-scramble-duration: 2.5s; --vb-scramble-chars: '01'">Binary transmission</h2>
Attribute / ClassValuesDescription
data-effect="scramble"Enables the scramble effect. Use with data-trigger="scroll".
CSS PropertyDefaultDescription
--vb-scramble-duration1.5sTotal scramble duration.
--vb-scramble-chars!<>-_\\/[]{}=+*^?#Character set for random characters.
--vb-scramble-speed30msFrame interval.

data-effect="shadow"

Elevated box-shadow decoration with a subtle lift animation. The element rises slightly and gains depth, transitioning from a light shadow to a more pronounced elevated shadow. Ideal for cards, panels, and call-to-action containers.

<article data-effect="shadow" data-trigger="scroll"> <h2>Elevated Card</h2> <p>Lifts with a shadow when scrolled into view.</p> </article> <article data-effect="shadow" style="--vb-shadow: 0 12px 32px oklch(55% 0.2 260 / 0.25);"> <h2>Custom Shadow</h2> <p>A branded shadow via --vb-shadow.</p> </article>
Attribute / ClassValuesDescription
data-effect="shadow"Enables the shadow lift effect.
data-trigger="scroll"Lift when scrolled into view.
class="slow"Slower lift duration.
CSS PropertyDefaultDescription
--vb-shadow0 8px 24px oklch(0% 0 0 / 0.18)Final elevated box-shadow. Override for branded shadows.
--vb-duration400msDuration of the lift animation.

data-effect="shake"

Rapid horizontal shaking animation. Useful for error states, attention-grabbing, or playful interactions. Runs continuously or on hover.

<span data-effect="shake">Shaking text</span> <button data-effect="shake" data-trigger="hover">Shake on hover</button>
Attribute / ClassValuesDescription
data-effect="shake"Enables the shake effect (continuous by default).
data-trigger="hover"Shake only on hover.
CSS PropertyDefaultDescription
--vb-shake-intensity4pxHorizontal displacement distance.
--vb-shake-duration0.4sDuration of one shake cycle.

data-effect="shimmer"

CSS-only shimmering highlight that sweeps across the text on a loop.

<h1 data-effect="shimmer">Shimmering Text Effect</h1> <h2 data-effect="shimmer" class="slow">Slow and Steady Shimmer</h2> <h2 data-effect="shimmer" class="fast">Quick Flash Shimmer</h2>
Attribute / ClassValuesDescription
data-effect="shimmer"Enables the shimmer effect (2s default cycle).
class="slow"Slow shimmer speed.
class="fast"Fast shimmer speed.

data-effect="slide-in"

Horizontal entrance animation that respects text direction. In LTR, the element slides in from the left; in RTL, from the right. Uses :where([dir="rtl"]) for automatic direction support.

<h1 data-effect="slide-in">Slides in from the left</h1> <h2 data-effect="slide-in" data-trigger="scroll">Appears on scroll</h2> <p data-effect="slide-in" data-trigger="scroll" style="--vb-slide-distance: 80px;">From further away</p>
Attribute / ClassValuesDescription
data-effect="slide-in"Enables horizontal entrance. Use with data-trigger="scroll".
class="slow"Slower slide duration.
class="fast"Faster slide duration.
CSS PropertyDefaultDescription
--vb-slide-distance40pxHorizontal offset distance.
--vb-duration400msDuration of the slide animation.

data-effect="slide-out"

Horizontal exit animation. The element slides out in the inline-end direction while fading. Mirrors slide-in with reversed direction and RTL support via :where([dir="rtl"]).

<p data-effect="slide-out" data-trigger="click">Click to slide out</p> <p data-effect="slide-out" class="slow" data-trigger="click">Slow slide out</p>
Attribute / ClassValuesDescription
data-effect="slide-out"Enables horizontal exit. Activates when data-effect-active is set.
data-trigger="click"Slide out on click.
class="slow"Slower slide duration.
CSS PropertyDefaultDescription
--vb-slide-distance40pxHorizontal offset distance.
--vb-duration400msDuration of the slide animation.

data-effect="slide-up"

Element slides upward into its final position while fading in. A clean, modern entrance animation commonly paired with scroll triggering.

<h2 data-effect="slide-up" data-trigger="scroll">Slides up into view</h2> <p data-effect="slide-up" data-trigger="scroll" class="slow">Slow slide entrance</p>
Attribute / ClassValuesDescription
data-effect="slide-up"Enables the slide-up entrance. Use with data-trigger="scroll".
class="slow"Slower slide duration.
class="fast"Faster slide duration.
CSS PropertyDefaultDescription
--vb-slide-up-distance20pxStarting offset distance below final position.
--vb-slide-up-duration0.6sDuration of the slide animation.

data-effect="sparkle" kawaii

CSS-only floating sparkle stars. Two ✦ characters orbit the element with staggered float animations — one gold at top-right, one lavender at bottom-left.

<span data-effect="sparkle">Sparkle Text</span> <button data-effect="sparkle">Sparkle Button</button> <h2 data-effect="sparkle">Sparkle Heading</h2>
Attribute / ClassValuesDescription
data-effect="sparkle"Adds floating sparkle stars via pseudo-elements.

data-effect="stamp" retro

Rubber stamp effect with fractal noise SVG filter, rotation, and mix-blend-mode: multiply. Requires JS for the SVG filter injection.

<span data-effect="stamp">APPROVED</span> <span data-effect="stamp" class="blue">CLASSIFIED</span> <span data-effect="stamp" class="gold heavy">CERTIFIED</span>
Attribute / ClassValuesDescription
data-effect="stamp"Enables the stamp effect. Empty defaults to red ink.
class="red", "blue", "green", "black", "gold"Ink color preset.
class="straight"No rotation (0deg).
class="slight"Slight rotation (-2deg).
class="heavy"Heavy rotation (-8deg).
CSS PropertyDefaultDescription
--vb-stamp-colorPer presetInk color in OKLCH.

data-effect="starburst" kawaii

Animated pastel starburst gradient background with rotating 10-degree conic-gradient rays and soft radial bokeh at the bottom.

<section data-effect="starburst"> <h2>Pastel Starburst</h2> <p>Animated rotating ray background.</p> </section>
Attribute / ClassValuesDescription
data-effect="starburst"Enables the animated starburst background.

data-effect="text-3d" retro

Bold text with layered drop-shadows creating a 3D extrusion effect. Sets font-weight: 900.

<h1 data-effect="text-3d">3D Text</h1> <h2 data-effect="text-3d" class="gold">Gold Extrusion</h2> <h1 data-effect="text-3d" class="red animate">Animated</h1>
Attribute / ClassValuesDescription
data-effect="text-3d"Enables the 3D extrusion effect.
class="red", "gold", "green", "purple", "black"Shadow color preset.
class="deep"Doubles shadow angle to 2px for deeper extrusion.
class="animate"Oscillates shadow direction over 3 seconds.
CSS PropertyDefaultDescription
--vb-3d-colorPer presetExtrusion color in OKLCH.
--vb-3d-angle1pxShadow offset per layer.

data-effect="typewriter" effects

Classic character-by-character typing with optional blinking cursor and looping. Triggers when scrolled into view.

<h1 data-effect="typewriter" data-trigger="scroll">Hello, World!</h1> <p data-effect="typewriter" data-trigger="scroll" style="--vb-typewriter-speed: 80ms; --vb-typewriter-delay: 500ms">This text types out more slowly after a brief pause.</p> <h2 data-effect="typewriter" data-trigger="scroll" class="loop">Loops forever</h2> <h2 data-effect="typewriter" data-trigger="scroll" class="no-cursor">No blinking cursor here</h2>
Attribute / ClassValuesDescription
data-effect="typewriter"Enables the typewriter effect. Use with data-trigger="scroll".
class="loop"Loop the typing animation.
class="no-cursor"Hide the blinking cursor.
CSS PropertyDefaultDescription
--vb-typewriter-speed50msTyping speed per character.
--vb-typewriter-delay0msInitial delay before typing starts.

data-effect="wiggle" kawaii

Playful left-right rotation wobble. Runs continuously by default, or only on hover.

<span data-effect="wiggle">Always wiggling</span> <button data-effect="wiggle" data-trigger="hover">Wiggle on hover</button>
Attribute / ClassValuesDescription
data-effect="wiggle"Enables the wiggle effect (continuous by default).
data-trigger="hover"Wiggle only on hover.

data-effect="ticker" effects

Animated number count-up on <data> elements. Counts from a start value to the element's value attribute using easeOutExpo easing — fast start, decelerating finish. Pairs with data-format-number for locale-aware formatting during animation.

<data value="50000" data-effect="ticker" data-trigger="scroll" style="--vb-ticker-duration: 2000">50,000</data>

Attributes

AttributeValuesDescription
data-effect="ticker"Enables animated count-up. Use on <data> elements with a value attribute.
data-trigger="scroll"Start animation when scrolled into view (IntersectionObserver, 10% threshold).
data-format-numbercurrency, percent, compactApply Intl.NumberFormat to intermediate values during animation.
data-currencye.g. USD, EURCurrency code when using data-format-number="currency".
data-localee.g. de-DEOverride locale for this element (defaults to html[lang]).

CSS Properties

CSS PropertyDefaultDescription
--vb-ticker-duration1000Animation duration in ms.
--vb-ticker-start0Starting number for count-up.
--vb-ticker-decimalsautoDecimal places (auto-detected from value if omitted).

How It Works

  1. The scroll trigger watches for the element to enter the viewport (10% threshold)
  2. A requestAnimationFrame loop animates from start to end value at 60fps
  3. Each frame applies easeOutExpo easing for a fast-start, decelerating finish
  4. Intermediate values are formatted with Intl.NumberFormat matching any data-format-number options
  5. At completion, sets data-format-number-init to prevent double-formatting

With Format Number

Combine with data-format-number for locale-aware formatting during the animation:

<data value="48200" data-effect="ticker" data-trigger="scroll" data-format-number="currency" data-currency="USD" style="--vb-ticker-duration: 2000">$48,200</data> <data value="1500000" data-effect="ticker" data-trigger="scroll" data-format-number="compact" style="--vb-ticker-duration: 2500">1.5M</data>

Stats Pattern

The ticker pairs naturally with the Stats pattern:

<layout-grid data-layout-gap="m" style="--layout-grid-min: 10rem;"> <article> <data value="24521" data-effect="ticker" data-trigger="scroll" data-format-number>24,521</data> <p>Active Users</p> </article> <article> <data value="48200" data-effect="ticker" data-trigger="scroll" data-format-number="currency" data-currency="USD" style="--vb-ticker-duration: 2000">$48,200</data> <p>Revenue</p> </article> </layout-grid>

Reduced Motion

The ticker checks prefers-reduced-motion: reduce and :root[data-motion-reduced]. When either is true, the animation is skipped entirely — the original text content is preserved as-is. data-format-number still formats normally.

Easing

function easeOutExpo(t) { return t === 1 ? 1 : 1 - Math.pow(2, -10 * t); }

See also: data element for byte formatting and locale overrides.

Shared Behavior

Progressive Enhancement

All effects are progressive enhancements. Text is fully readable without JavaScript. CSS-only effects need no JS at all. Effects without a pack badge are in core.

Reduced Motion

All effects respect prefers-reduced-motion: reduce and :root[data-motion-reduced]. When reduced motion is active, text displays immediately with no animation.

Screen Readers

JS effects that split text into spans set aria-label on the host element so screen readers announce the full text naturally.

Scroll Trigger

Effects with data-trigger="scroll" use IntersectionObserver with threshold: 0.1 to trigger when scrolled into view. Effects play once (except data-effect="typewriter" with class="loop").

Dynamic Elements

A MutationObserver watches for dynamically added elements, so effects work with client-side rendering and lazy loading.

CSS Layer

Core effects use @layer web-components. Pack effects use @layer bundle-effects.

Accessibility

  • aria-label preserves full text for screen readers
  • prefers-reduced-motion respected by all effects
  • CSS-only effects degrade gracefully in older browsers via @supports
  • No content is hidden permanently — text is always accessible
  • Guard attributes (data-*-init) prevent double initialization