Declarative motion · Spring physics · Interruptible

Animate with HTML tags

Declarative by default. A JavaScript API when you need it.
Physics-based motion for any framework. Built on Motion.

Quick install npm install motion-components

motion-curvesmoothly looping text with wave animation

How it works

One tag.
Works in native HTML.

Drop a tag anywhere. No config, no wrappers, no boilerplate.

  1. 1
    Install

    Run npm install motion-components, or load it from a CDN with one script tag, as in the example.

  2. 2
    Import once

    import 'motion-components' registers all custom elements globally.

  3. 3
    Wrap anything

    Compose motion-hover, motion-reveal, and friends around your existing markup.

// 1. install
npm install motion-components

// or, with no build step, one tag in your HTML
<script type="module" src="https://cdn.jsdelivr.net/npm/motion-components@1/+esm"></script>

// 2. import once — works in any framework
import 'motion-components'

// 3. wrap anything
<motion-hover scale="1.1" y="-6">
  <button>Hover me</button>
</motion-hover>

<motion-reveal>
  <h2>Smooth entrance</h2>
</motion-reveal>

<motion-stagger>
  <div>One</div>
  <div>Two</div>
  <div>Three</div>
</motion-stagger>

Primitives

Feel the difference.

Composable primitives. Each one is interactive. Try them.

Text Effects

Words in motion.

Components for animated text: split, typewriter, counter, rotating words, swaps, and marks that draw onto words.

Theming

Light, dark, and system.

<motion-theme-toggle> switches themes with a spring sun-to-moon morph, and an optional circular wipe from the control.

Inbox
Release notes are ready for review
Design sync moved to Thursday
3 new comments on the roadmap
  • Four looks: icon, segmented toggle, switch and drop-down menu.
  • Remembers the choice and follows the OS setting when set to system.
  • Drop-in compatible with Chrome Labs' dark-mode-toggle attributes and events.
  • Try the header: the theme menu on this site is the same component.

Animated icons

Icons that move.

<motion-icon> draws in, pops or wiggles any SVG icon from Lucide, Tabler, Heroicons, Material Symbols, Font Awesome and more. <motion-icon-state> morphs between two states on a spring.

heart · draw pulse · tinted

Hover the icons. Click one to preview it and copy its code.

Why motion-components

Built different.

Spring physics

Every animation uses spring dynamics: naturally interruptible, with no jarring cuts.

Framework-agnostic

Standard web components work anywhere: React, Vue, Svelte, Astro, or raw HTML. No adapter needed.

Composable primitives

Build complex interactions by wrapping: nest motion-hover inside motion-stagger effortlessly.

Zero config

Sensible defaults out of the box. Attributes let you tune, but you never have to.

TypeScript ready

Full type declarations included. Attribute names and values are typed for IDE autocomplete.

Accessible by default

Respects the reduced motion setting. Animations skip cleanly: no flashes, no layout shift.

Pick a goal. Find the tag.

Still want more?

Four more areas to explore. Hover to reveal what's inside.

Start shipping motion today.

Drop a tag in your HTML and you're done.