/ui:animate-app-interactionsfrom Diorama UI
Animates state changes in apps using Diorama components. Covers Presence, TextSwap, IconSwap, Count, Stagger, and motion tokens for reduced-motion support.
Ships in Diorama UI. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Choose one owner for each animation:
| Moves | Owned by | You do |
|---|---|---|
| A Diorama component — Modal, Menu, Popover, Tooltip, Select, Switch, Checkbox, Accordion, Toast, Drawer… | the component, from the motion tokens | nothing. Do not add a transition, keyframe or snippet class to it or its parts |
| An effect — shimmering status text, a sheen, a glow | the effects layer, fx("shimmer") etc. | apply the class (the apply-effects skill) |
| Something arriving or leaving — a row added to a list, a row folding away once done, a message landing in a stream | Presence (fade · rise · collapse) | wrap the keyed items; see § Presence |
| A short label changing in place — Save changes → Saved, Follow → Following, a status word | TextSwap | <Button><TextSwap>{label}</TextSwap></Button>; one line of text, a string |
| A glyph that means a state changing — Copy → tick, play → pause, bell → muted bell | IconSwap | <Button isIconOnly aria-label={name} icon={<IconSwap icons={{ copy: <Copy />, check: <Check /> }} show={key} />} />; change the name with the glyph |
| A number changing — a total, a cart, an unread count, a live readout | Count | <Count value={n} format={…} locale="sk-SK" />; its text is always the plain value |
| A group arriving on first load — a dashboard's cards, an empty state filling | Stagger | wrap the keyed items; infrequent moments only (CONVENTIONS §8) |
| An answer to an action — a field shaking on a wrong code, a check written in on success | useShake(), SuccessCheck | const { ref, shake } = useShake(); render <SuccessCheck /> when success happens; keep the static cue |
| A product interaction the library has no component for yet | the app, with transitions.dev snippets | follow this skill |
Use a snippet only when no library component or effect owns the interaction.
Two transition declarations on one element do not combine; one wins.
For easing, travel and coordinating opacity with movement, see polish-interface, rules 6–11a. In app code:
--ui-duration-* / --ui-ease-* /
--ui-motion-*, or a snippet's own variables. Never a literal ms in a
component, never transition: all. Use --ui-duration-base to arrive
and --ui-duration-fast to leave; reserve --ui-ease-spring for entrances.@/lib/motion
(motionMicro, motionStandard, motionDeliberate) with a literal
property list: cn("transition-[opacity,transform]", motionStandard).
A class name assembled at runtime (`transition-[${p}]`) is never seen
by Tailwind's scanner and silently does not exist.full, reduced, off
(ADR 0028; next section). A snippet's own variables do NOT follow them —
the snippet guards itself in CSS against the OS preference only, so wrap it
in a motion-safe:/@variant motion-safe guard if it must respect the
app's setting, and your JavaScript must check (below).Presence from @/ui/presence is the library's answer for anything that
enters or leaves, so it replaces a snippet for those cases:
<ul>
<Presence kind="collapse">
{rows.map((row) => <li key={row.id}>{row.title}</li>)}
</Presence>
</ul>
fade (default) in place; rise for content landing in a stream;
collapse for list rows, so the rows below glide instead of jumping.appear
opts the first render in.className and ref; Presence owns transition on
it, so put no other transition or snippet on the same element.collapse folds the row's whole box — height, vertical padding, border
and margin — so padded rows close smoothly. A height animation of your
own needs the same: a padded element animated on height alone stalls at
its padding and then jumps shut.| Level | What the library does |
|---|---|
full | everything, at the tokens |
reduced | nothing travels (slides become fades, scale-ins start full size, no stagger), loops stop; change in place still eases |
off | every duration is 1ms |
reduced if it asks for
less, otherwise full.data-ui-motion="reduced" or "off" on any element sets its subtree, and
is always honoured — even when an outer element says full. Use it freely
for a region that must stay calm (a dashboard of live tiles).data-ui-motion="full" overrides the OS preference. Set it only from a
choice the user made in your app's settings, never as a default, a theme
or a marketing page's wish.<html>: offer "Follow the
system" (no attribute), "Full", "Reduced" and "Off"; persist the choice;
apply it before first paint (an inline script reading the stored value), so
the page does not animate once at the wrong level.transitions.dev (© Jakub Antalik) is not MIT. Its licence lets you use, copy and modify the transitions inside your own product; it forbids republishing the collection, or a substantial part of it, as a transitions library, motion pack or animation kit. Full terms: https://transitions.dev/terms.html. That is why this skill contains no snippet code — it ships into other people's repositories, which would be republishing.
npx skills add Jakubantalik/transitions.dev, and load transitions-dev
(snippets), transitions-polish (tuning) as needed. Do not commit the
skill's files — git status after installing, and ignore whatever it
added.src/styles/transitions.css), imported after the theme. Keep each one
verbatim — selectors, the enumerated transition list, its
reduced-motion guard. Re-point only colours, at Diorama roles.transition (often
display too) on its element. Need two? Two wrappers.inert so focus cannot land in it.textContent, and give the element an aria-label with the value.
Count avoids the problem by construction — use it rather than a snippet.polish-interface
rule 10), hidden from assistive tech; the button's label carries the state.
IconSwap does exactly this — use it rather than a snippet.el.classList.remove("is-playing");
void el.offsetHeight; // reflow commits the removal
el.classList.add("is-playing");
In React, the same is a state reset followed by requestAnimationFrame.const ms = (name: string, fallback: number) => {
const v = parseFloat(getComputedStyle(document.documentElement).getPropertyValue(name));
return Number.isFinite(v) ? v : fallback;
};
then waits ms(...) + 50 before cleaning up. A copied 300 drifts the
first time someone tunes the CSS.motionLevel(element) from
@/lib/motion — never matchMedia("(prefers-reduced-motion: reduce)"),
which ignores the app's setting — and below full skip the phases: swap
the text at once, skip the shake, rather than running timers against a
transition the CSS has already shortened. Something long-lived (a clock, a
ticker) re-asks through subscribeMotionLevel.motion/mini's animate() — never <motion.*> (ADR 0018). The
eslint-preset item enforces it.Every animated change also changes something static: a label, a colour, an icon, a count. A count that only pulses, or a row that only fades, says nothing to someone with reduced motion on, and nothing once it has settled.
Animation.setPlaybackRate at 0.1 over CDP in a Playwright check.data-ui-motion set to reduced and to off on <html>, and with the OS
preference on.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
diorama, motion-tokens, presence-animation, text-swap, icon-swap, count-animation
npx claudepluginhub bydiorama/ui --plugin ui8 skills in this plugin
/apply-effectsApply glass, grain, sheen, glow, shimmer, ink or shaders to Diorama components. Use when adding texture, emphasis, a gradient ground or a loading halo without changing the component API./build-demo-pageTurn a screen design into a scripted, interactive demo page. Use when storyboarding a UI walkthrough, animating a Paper mockup, or preparing component snippets and compositions for capture./compare-ui-to-designMeasure a rendered screen against a Paper or Figma design. Use when asked to match a frame, explain a spacing or size difference, export a reference, or set up pixel diffs in an app./design-componentDesign a component and its states before implementation, as a contract in code drawn in Paper or Figma. Use when turning references into a token-based spec, extending a component sheet, drawing motion frames or preparing a handoff./hydrate-componentsUse Diorama components in Astro, SSR and static exports. Use when deciding what must hydrate, composing compound components in an island, or debugging a control that looks right but does nothing./polish-interfacePolish an interface built with Diorama components. Use when spacing, radii, elevation, type, icon alignment, hit areas or interaction states look or feel wrong without a specific design frame to compare.Other plugins' skills for the same job