Deft
Ask AI

Search

Search skills, authors and topics

Jakubantalik / transitions.dev

transitions-dev

Production-ready CSS transitions for web apps. Use when implementing notification badges, dropdowns, modals, panel reveals, page transitions, card resizes, number pop-ins, text swaps, icon swaps, success checks, avatar group hovers, error state shakes, search/input clear, skeleton loaders, shimmer text, sliding tabs, tooltips, staggered text reveals, card hover tilt, plus-to-menu morph, accordions, toasts, like buttons, learn-more hovers, checkbox checks, spinning counters, toggles, AI thinking states, reasoning streams, streaming text, matrix dot loaders, or banner stacking. Triggers on "add a transition", "animate the dropdown", "make the modal open smoothly", "swap icon", "page slide", "stagger animation", "open / close transition", "make it animate", "fade between", "success animation", "form error", "shake on invalid", "hover lift", "avatar stack hover", "clear the search", "skeleton loader", "loading shimmer", "shimmer text", "sliding tabs", "segmented control", "tooltip", "reveal text", "tilt card", "3D hover tilt", "cursor glare", "plus to menu", "FAB morph", "accordion", "collapsible", "expand / collapse", "disclosure", "toast", "snackbar", "like button", "heart animation", "learn more arrow", "checkbox", "check animation", "spinning counter", "odometer", "slot machine digits", "toggle", "switch", "thinking states", "AI status line", "agent reasoning", "reasoning stream", "streaming text", "stream words in", "matrix loader", "dot loader", "banner stack", "stacked toasts". Also "motion tokens", "scan for ad-hoc transitions", "replace hardcoded durations with motion tokens", "tokenize my animations", and the commands transitions reveal, transitions review, transitions apply, transitions refine.

Install

npx skills add https://github.com/Jakubantalik/transitions.dev --skill transitions-dev

Streaming text

When to use

Model output arriving word by word — chat responses, AI completions, any streamed paragraph. JS wraps each word in a span; words rest visible, and a replay wipes them all, then resolves them in order through opacity plus a small blur, one every --stream-gap.

Reach for this over a typewriter effect when the text should feel like it condenses into place rather than being typed — the cross-blur reads as resolution, not keystrokes.

HTML usage

html
<div class="t-stream">Your streamed paragraph…</div>

JS wraps each word in a .t-stream-w span; spans rest visible. To replay the stream: wipe every span with transition: none, force one reflow, restore the transition, then add .is-in word by word every --stream-gap — each word resolves through opacity + a small blur over --stream-fade.

Tunable variables

VariableDefaultNotes
--stream-gap60mssourced from --p30-word-gap
--stream-fade350mssourced from --p30-word-dur
--stream-blur1pxsourced from --p30-blur
--stream-easecubic-bezier(0.22, 1, 0.36, 1)sourced from --p30-ease

The :root defaults below match the live tuning on transitions.dev. Drop them into your global stylesheet once — every transition in this skill reads from semantic names like these, so multiple transitions can share a single :root block.

css
:root {  --stream-gap: 60ms;  --stream-fade: 350ms;  --stream-blur: 1px;  --stream-ease: cubic-bezier(0.22, 1, 0.36, 1);}

CSS

css
.t-stream-w {  opacity: 0;  filter: blur(var(--stream-blur));  transition:    opacity var(--stream-fade) var(--stream-ease),    filter var(--stream-fade) var(--stream-ease);}.t-stream-w.is-in {  opacity: 1;  filter: blur(0);}
@media (prefers-reduced-motion: reduce) {  .t-stream-w { transition: none !important; filter: none !important; opacity: 1 !important; }}

The @media (prefers-reduced-motion: reduce) guard at the bottom of the snippet is required — keep it. It zeroes the transition for users who have asked for less motion at the OS level.

JavaScript orchestration

js
// Wrap each word in a span once; stream() wipes them (no transition)// and resolves them in order, one every --stream-gap.const block = document.querySelector(".t-stream");const words = block.textContent.trim().split(/\s+/);block.textContent = "";const spans = words.map((w, i) => {  const s = document.createElement("span");  s.className = "t-stream-w is-in";  s.textContent = w;  block.appendChild(s);  if (i < words.length - 1) block.appendChild(document.createTextNode(" "));  return s;});
const gap = parseFloat(  getComputedStyle(document.documentElement).getPropertyValue("--stream-gap")) || 60;
function stream() {  // Snap back to nothing without animating the wipe itself.  spans.forEach((s) => {    s.style.transition = "none";    s.classList.remove("is-in");  });  void block.offsetWidth; // flush the wipe  spans.forEach((s) => { s.style.transition = ""; });  (function next(n) {    if (n >= spans.length) return;    spans[n].classList.add("is-in");    setTimeout(() => next(n + 1), gap);  })(0);}