data-anim

Animate with just HTML

Drop-in scroll animations using HTML attributes. Built-in anti-FOUC protection. Under 2KB. No dependencies.

$ npm install data-anim

No JS to Write

Pure CSS animations triggered by HTML attributes. Just add data attributes.

Anti-FOUC Built-in

3-layer defense against Flash of Unstyled Content. No manual CSS workarounds needed.

Under 2KB

Tiny footprint. No dependencies. Loads in under 5ms. Smaller than most favicons.

TypeScript Support

Full autocomplete for all data-anim attributes in React and Vue. Just import and go.

Three lines. That's it.

No config files. No build step. No framework required.

index.html
<!-- 1. Add the script -->
<script src="https://unpkg.com/data-anim@latest/dist/data-anim.js"></script>

<!-- 2. Add the attribute -->
<div data-anim="fadeInUp">
  Your content animates on scroll
</div>

<!-- 3. There is no step 3 -->

Animation Library

30+ built-in animations

From subtle fades to playful bounces. Every animation is GPU-accelerated and respects prefers-reduced-motion.

Fade

Smooth opacity transitions with optional directional movement.

fadeInfadeInUpfadeInDownfadeInLeftfadeInRight

Slide

Full-width entrance animations from any direction.

slideInUpslideInDownslideInLeftslideInRight

Zoom

Scale-based entrances for impactful reveals.

zoomInzoomOutzoomInUpzoomInDown

Bounce

Playful multi-step animations with overshoot.

bouncebounceInbounceInUpbounceInDown

Attention

In-place effects for drawing the eye. Perfect for hover and click.

shakepulsewobbleflipswingrubberBand

Rotate & Special

Rotation entrances, blur reveals, and more.

rotateInblurclipRevealtypewriter