Requirements
- Any bundler, or none. The prebuilt stylesheet is plain CSS.
- Tailwind CSS v3 or v4 for the appearance around the motion — optional, but TailMotion is designed to sit next to it.
- Node 16+ only if you install from npm.
TailMotion ships no JavaScript in its CSS core. Nothing on this page installs a
runtime, an animation library, or a React component.
1. Install
2. Import the stylesheet
3. Add motion to something
tm-press is a transition, so releasing early reverses smoothly instead of
snapping. tm-slide-block-start is a keyframe entrance that travels toward the
block-start edge — the name says the direction, and it mirrors itself in
right-to-left contexts.
4. Give the whole surface a personality
One class on an ancestor retunes every TailMotion descendant. Nothing below it changes.
Duration is a factor, not a value, so each animation keeps its own relative
character —
tm-pop stays livelier than tm-fade-in in all three. Full detail
in Motion personalities.
5. Animate the state you already have
If your component knows whether the menu is open, TailMotion can read that directly. No second source of truth, no runtime.data-state between "open" and "closed" and the panel animates both
ways. aria-expanded, aria-pressed, aria-checked and .tm-open /
.tm-closed all work too.
6. Animate a native element
[popover], <dialog> and <details> are the three elements the browser
already handles correctly, and the three that were historically impossible to
animate out. Modern CSS fixed that.
7. Sequence a list
data-state to "closed" and the list leaves in sequence. Add
tm-stagger-from-end and it leaves last-item-first, with nothing reordered in
the DOM. See Choreography.
What you did not have to do
- Install an animation runtime.
- Write an
@keyframesblock. - Fork a component to change a duration.
- Add an
IntersectionObserver. - Write a
prefers-reduced-motionmedia query. - Write a right-to-left variant.
Next
Installation options
Tailwind v3, Tailwind v4, the CDN, and the optional plugin.
The motion model
How the four token groups compose, and which class to reach for.