Attributes

data-viv — the composition

Keys (prefix @) are animations; modifiers (prefix _) tune timing, intensity and targeting. Modifiers concatenate directly onto a key — the _ delimits them — and separate keys are space-separated:

html
<div data-viv="@fd @sl-y_ease-out-back_delay-2">

That's one fade, plus one slide-up carrying an easing and a delay. Everything applies to the same element, so where a modifier sits is just notation — attach it to the key it belongs with for readability.

Variant grammar

SuffixMeaningExample
-x / -y / -zaxis@sl-x, @rt-z
-ienter variant@sc-i grows in
-oexit variant@fd-o fades out
!invert direction@sl-y! slides from below

Friendly tuning attributes

For one-off tweaks you don't need modifier tokens — dedicated attributes map onto the underlying CSS custom properties:

AttributeMaps toExample
data-viv-duration--AD600ms, 0.6s, 0.6
data-viv-delay--ADL0.2, 200ms
data-viv-ease--AEout-back, linear, any cubic-bezier()
data-viv-repeat--AC3, infinite

Raw custom properties

Everything above compiles down to CSS custom properties, and you can always set them inline for full control:

html
<div data-viv="@sl-y" style="--AD: 1.2; --AL: 2; --AE: var(--Aout-expo)">
PropertyRoleDefault
--ADduration base (seconds)0.5
--ASspeed multiplier1
--AEeasingease
--ACiteration count1
--ADLdelay0s
--ALintensity level — scales distances, angles, springs1
--AOXYtransform origin50% 50%

Engine-managed attributes

The engine writes data-viv-state (idle → armed and hidden, play → running/finished) and reads data-viv-paused to freeze playback. You normally never touch these — use the API instead.

Portrait of Axel RAKOTOARIVAO
Created by
Axel RAKOTOARIVAO
MIT — keyframe DSL inspired by A.css
bun add vivace-css