Guides animation decisions for UI elements like modals, menus, tooltips, buttons, and page transitions. Covers easing, timing, springs, stagger, arcs, press/hover states, and UX laws.
Ships in design. 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.
Read when SKILL.md points to them.
Every interaction answers six questions, in this order: should it move, does it answer at once, where should the eye go, how should it move, can people find it, hit it, choose it and type into it, and can they finish. A later answer never rescues an earlier one: the best curve on an animation that shouldn't exist is still wrong.
motion or framer-motion, React Spring, WAAPI) and write in that. State changes stay CSS transitions. Where Motion is installed, use it only for what CSS can't do: animating an element out as it unmounts, layout changes, and springs that follow a finger. A change a CSS transition can do never pulls in a library, and a project that has Motion never gets a hand-written spring. Why: two systems animating the same kind of change drift apart in timing and in how they handle interruption.recipes.md has exact values and code for modals, drawers, popovers, tooltips, toasts, entrances, exits, expanders, icon swaps, async buttons, press, number rolls, text morphs, fluid morphs, progress bars, sliders, carousels and the theme switch. techniques.md has the curve library, springs, interruptibility, arcs, mapping one value to another, rubber banding, loops, masks, cross-fades, storyboards, live tuning, performance and a symptom table. Both open with a contents line; read the section a rule links to.
Reviewing instead of building? Unless asked to fix, change nothing. Open the report with the interaction list from step 2, then write one table row per finding: severity, rule, where (file and line, or the frame), before, after. Severity is broken (a wrong result, lost input, a blocked or skipped step, something a keyboard or screen-reader user can't reach, motion that hides what people need or ignores a reduced-motion setting), friction (slower or more confusing than it needs to be) or polish. Sort by severity, then by the six questions: a failed Verify check sorts under the question it serves (reduced motion under 4), and unnamed numbers (step 4) sort last. A bug no rule covers still gets a row, with "no rule" as its rule, so it sorts with the rest.
What starts it, and how often?
├── The keyboard (arrow keys, shortcuts, ⌘K, Tab, focus moving)
│ → no animation. The new state shows on the next frame.
├── Something one person does many times a day (a list they sweep with the pointer,
│ a toolbar, tabs or a palette in a tool they live in)
│ → no animation, hover highlights included: on and off at once.
├── Something they do a few times a session (a menu, popover, modal, drawer, toast, a save)
│ → animate, inside the timing table in question 4.
└── A moment they won't repeat today (onboarding, a first success, finishing a big task)
→ may be choreographed: each move up to 500ms, the whole sequence up to 2.5s.
Then: does the motion answer a question (where it came from, whether the action registered,
what changed, what caused it)?
├── No → cut it.
└── Yes → keep it, and make the motion show the answer ("Make it mean something", question 4).
Don't animate the next tooltip. The first tooltip in a group waits for its delay (the library's default, 600–700ms) and animates in. Once one is open, moving to its neighbour shows the next one at once, skipping both the wait and the transition (tooltip). This holds on a toolbar used all day too: the delay keeps tooltips from flashing as the pointer crosses it, and only the first one animates. Keyboard focus shows a tooltip at once, with no delay and no transition. Why: the delay is there so a passing pointer doesn't open one by accident. Once someone is reading tooltips they've already waited once, and every further wait is pure lag.
On first load, nothing plays an entrance just for being there: motion is for the changes people make once the page is up. Motion's AnimatePresence takes initial={false} for this: use it around toggles, tabs and icon swaps, and never around a first-run entrance whose whole point is to play. Why: an entrance on every load replays on every refresh and back navigation, and holds back content people already know is there.
People stay in flow when the interface answers within 400ms (the Doherty threshold).
One primary motion at a time: the element the person touched, or the one that answers them. Everything else holds still or recedes (a 40–50% black scrim behind an expanded card, siblings at 0.5 opacity). Motion is the strongest signal on a screen, so whatever moves gets looked at: spend it on what matters. When one action sets off several different motions, chain them: each starts as the one before lands (the photo reaches the cart, then the badge bumps), never side by side. Why: the eye follows one thing; two motions at once split attention and neither lands.
Chain animations with a stagger. When several copies of one element enter together (list rows, cards, menu items, a radial menu's buttons), start each a little after the one before instead of moving them as one block: 40–70ms apart, the longer gap when there are only 3 or 4, and only the first 6 offset (the rest arrive with the sixth). Distinct pieces of one section (the heading, then the copy, then the actions) enter 80–100ms apart. Content riding in on a container that's already moving (a drawer's rows, a modal's body) arrives with the container, in one piece. Why: a small offset reads as one gesture with an order and leads the eye through the group, a block reads as a slide, and a stagger inside a moving container competes with the container.
One element per view breaks the pattern around it: the primary action, filled in the accent colour. Never two. Pair the colour with size, weight or position, because colour alone fails people who can't see it. Why: people notice and remember the one thing that differs, and two "different" things cancel each other out.
People remember the first and last items of a sequence best. Put the most important items at the ends (the first and last tabs, the top of a menu) and the least-used in the middle, and open every screen with what it's for. Why: attention dips in the middle.
Only on top of a primary motion, never alone, and only in the rare moments from question 1. It starts with the primary or up to 100ms after, ends within 150ms of it, and moves at most a third as much: the check draws in, then a ring scales from 1 to 1.4 as it fades. Why: it backs the main action up, and as soon as it's as big or as long, it competes with it.
Only where a moment must register: an error on submit, a failed attempt (a wrong password, a declined card), a first success. An error shake moves the wrong field through translateX 0, −10, 10, −6, 6, −3, 0px over 360ms, puts focus there and shows the message beside it. Never on blur, and never on neutral changes like opening a menu or switching tabs. Why: exaggeration is a volume knob, and if everything is loud, nothing is.
| What | Duration |
|---|---|
| Press, hover, colour | 100–150ms |
| Tooltip | 125ms |
| Dropdown, popover, select | 150–250ms |
| Modal, drawer, sheet, toast | 200–300ms |
| Moving or resizing in place (a progress fill, rows closing a gap, a reorder, an expander) | 200–300ms |
| Page transition, shared-element move, something flying to a new place | 300–400ms |
| Rare, choreographed moment | up to 500ms a move |
Keep animations fast: everything people open and close stays under 300ms, and only moves across the screen take longer. Within a range, bigger elements and longer distances take the longer end. If it feels slow, cut the duration before touching the curve. Why: duration is most of the feel. The same select feels instant at 180ms and sluggish at 400ms.
Exits are 20–30% shorter than their entrance, and quieter: a fade with at most a small move, an 8–16px nudge toward where it's going or back to the scale it entered from, never its full height. The exception is something whose destination is the point (a drawer closing, a card swiped away): it leaves the way it came. Never an instant display: none on something that animates in, which loses where it went; what question 1 keeps still shows and hides at once. Anything kept mounted so it can animate out is inert while closed (the inert attribute and pointer-events: none). Why: people stop watching something the moment they dismiss it, so a long exit only holds up what comes next.
Feel. Motion carries a brand the way type and colour do. Pick its character once, from the brand, and put it in the tokens:
Product UI (anything people use to get a task done)? → the table as written, whatever the brand. Speed first.
Marketing surfaces (landing pages, launch pages, the site around the product):
├── The brand sells speed (developer tools, infrastructure) → the low end of every range, or no animation.
├── The brand sells calm, trust or luxury → up to 1.5× the table, on `ease` instead of the ease-out curve.
├── The brand is young and loud → the ease-in-out curve on entrances too.
└── Unsure → the table as written.
Why: slow, soft motion reads as unhurried and premium, and instant motion reads as fast, but people use a product many times a day, so only marketing pages, which they see once, can spend time on feel.
Follows a finger, or can be thrown or redirected mid-gesture (drag, swipe, sheet, slider, carousel)?
→ spring: Motion { type: "spring", duration: 0.5, bounce: 0 }.
Bounce 0.1–0.3 only for playful, physical objects; never more.
Entering or leaving the screen (popover, menu, modal, toast, page)?
→ ease-out: cubic-bezier(0.32, 0.72, 0, 1), for the entrance and the exit
Staying on screen while it moves or changes size?
→ ease-in-out: cubic-bezier(0.77, 0, 0.175, 1)
Hover or colour?
→ ease, 150ms
Constant rate, where the motion is time itself (spinner, marquee, countdown, hold-to-confirm ring)?
→ linear
ease-out and ease-in-out are too gentle to read as a decision for anything that moves or scales, and a stronger custom curve feels more energetic (curves has softer and stronger ones). The ease keyword is fine for colour and hover.transition: all. Name each property. Why: all also animates whatever else changes, like a theme's colours or a position a script sets every frame.--radix-<component>-content-transform-origin (--radix-popover-content-transform-origin, for one), Base UI as --transform-origin, and anywhere else you set transform-origin to the trigger's side by hand. CSS's default origin is the centre, which is wrong for anything anchored to a button. Why: growing out of the button shows where it came from. A modal has no trigger beside it, so it scales from its centre.scale(0). Popovers and menus start at 0.95, tooltips and modals at 0.97 (a tooltip is too small to need more, and a modal too big to take more), always with opacity: 0. Why: nothing real appears out of a single point. From 0 it looks like it came from nowhere; from 0.95 it already has a shape.:active), with a 150ms transition on the ease-out curve, so letting go mid-press glides back; never below 0.95. Why: the button answers the press before the result arrives, so the interface feels like it's listening. Surfaces wider than 200px (cards, rows) change background on press instead, because 3% of a wide surface is a jump. Dense controls used all day (toolbars, editor chrome) skip the scale and darken their background on press instead, with no transition, so give the button component an opt-out (press). When the element already has a transform, put the scale on a wrapper.@media (hover: hover) and (pointer: fine) (Tailwind v4's hover: variant already checks hover: hover). Why: fingers can't hover. A tap fires the hover state and can leave it stuck after the finger lifts, which is never what the person meant..card:hover .card-inner { translate: 0 -4px; }. Why: an element that moves itself slides off the cursor, loses its hover, slides back and flickers.Move things along arcs. When something travels between two points that differ on both axes by more than 40px (a product photo flying to the cart, a thrown card, a floating button moving to a corner), move it on a curve that bulges 10–20% of the distance off the straight line (arcs). Moves along one axis (drawers, list reorders) stay straight. Why: anything thrown in the real world falls as it flies, so its path bends, and a straight diagonal looks mechanical.
Add scale and shadow mid-air. On the arc, scale the object up to at most 1.3 at the peak and back, and grow its shadow with it (from 0 2px 4px to 0 24px 32px), so it rises off the page instead of sliding across it. Why: scale and shadow together read as height, and the object feels alive in the air.
When a container stops, the non-text parts inside it settle a beat later: a toast's icon, a sheet's grabber, a dragged card's image. Drive them with a softer spring than the parent (damping ratio 0.7–0.85) or start them 20–40ms after it, with overshoot under 4% of the travel. Text never lags or wobbles, so an all-text panel arrives in one piece, and nothing people use many times a day gets follow-through. In a rare moment, the hero object's last settle may rebound for up to 1s, because by then the person already knows what happened. Why: parts that all stop on the same frame read as one rigid sticker.
Only for things that behave physically: something that bounces, lands, is dropped, caught or flung (a dock icon, a badge landing, a drag-and-drop drop, a slider thumb jumping to a value). Stretch along the direction of travel in step with speed, so it peaks mid-move and is gone when the object stops, and squash on impact. Keep scaleX × scaleY close to 1. A small round thumb (64px or less) may reach 1.3 × 0.85 at full speed; anything larger stays within 15%. It settles within 250ms of stopping. Squash the shape, never the text in it, and never inputs, layout containers or anything read while it moves. Why: it shows weight and speed, while on rigid UI it looks broken.
Define the states (closed and open; idle, pressed and done) or keyframes at explicit offsets, and let the engine fill in between. Write frame-by-frame code only for motion driven live by input: drag, scroll, cursor. Why: poses keep motion predictable and tunable in one place.
Anything that flips, tilts or turns gets real depth: perspective of 600–1000px on its parent (lower exaggerates the depth), transform-style: preserve-3d, and backface-visibility: hidden on each face. Never fake a flip with scaleX. Light it: darken the face turning away, up to 30% black at 90°, and shrink the shadow as it lifts. Press feedback goes on the parent, so it never overwrites the rotation. In a 3D carousel, leave more room around the centre item than between the items behind it, so turned items never cut through each other, even mid-drag. Why: without perspective, a rotation renders as a flat squeeze.
Borrow a real object's behaviour, so the motion carries the meaning, and never animate for its own sake:
Why: motion that matches a real thing reads at once; motion that's only decoration has to earn a reason it doesn't have.
When text changes in place while people are looking at it, walk this:
Did the person type it, or does it change with every keystroke (a word count, characters left)?
→ no animation. It updates on the next frame.
A number (a count, a price, a stepper, a timer, a dial's readout)?
→ per-digit blur roll ([number roll](references/recipes.md#number-roll)).
A label of one to three words (a button, a status, a toggle's text)?
→ text morph: letters both words share glide to their new places, the rest fade
([text morph](references/recipes.md#text-morph)).
Longer text?
→ cross-fade in place, old and new at once, 200ms, through a 4px blur.
aria-hidden, with the full text beside them, visually hidden.Treat the interface as one space where any element can become another. When a state changes inside one region, walk this before animating anything:
Does an element in the old state have a counterpart in the new one?
(the button that opens a form, the card that opens its detail, the highlight under the selected tab)
├── Yes → it becomes its counterpart: one element morphing its position, size, radius and fill
│ (Motion's layoutId, or a shared view-transition-name), 300–400ms on a spring with no bounce.
│ Its content fades through a 4px blur and never stretches ([fluid morphs](references/recipes.md#fluid-morphs)).
├── Is something going somewhere on screen (an item to the trash, a product to the cart)?
│ → it travels there on an arc and lands. It never vanishes here and appears there.
└── Nothing carries over → the container reshapes while the old content fades out and the new fades in.
Never a hard cut.
Why: a cut makes people find everything again. An element that becomes the next state keeps them oriented, and a change that flows feels faster than one that cuts, even when both take the same time to load.
When one element replaces another in the same spot (a label becomes a spinner, a copy icon becomes a check, one card replaces the next):
AnimatePresence mode="popLayout": the default sync mode keeps the leaving element in the layout, so the two sit side by side and the new one jumps into place when the old is removed. Why: a swap in sequence doubles the wait for nothing new, and a swap that shifts the layout makes the icon jump.Never block input while something animates. Why: an interface that makes you wait for its animation is slower than one with none.
Only for ambient objects and rare moments (a hero object, an idle hint, a floating badge): layer a small loop on top of the main motion, a vertical drift within ±10px and a 1–3% scale, out of phase with each other. Drive every loop with a sine wave rather than keyframes, and offset each item's phase rather than delaying its start (loops). Pause loops while they're off screen. Never loop anything people are reading or aiming at. Why: a keyframe loop shows a seam where it turns around, and a moving target is harder to hit.
Move and resize with transform and opacity only; colour and stroke-dashoffset are fine, and blur stays under 20px. Never animate width, height, top, left or margin: collapse a removed row with FLIP (measure, then animate the transform), and open an expander with grid rows (expanders). Fix shaky animations with will-change: transform on the element that shifts by a pixel at the start or end of its move, and on nothing else. Why: the browser hands the element between CPU and GPU rendering as the animation starts and ends, and the two draw it a pixel apart; will-change keeps it on the GPU for the whole move. Each element it promotes costs memory, so it never goes on everything.
Space is the first grouping signal people read. Things that belong together sit closer to each other than to anything else: the gap between groups is at least twice the gap inside one, and a label sits closer to its own field than to the field above. Why: distance reads as relationship before a single word does.
Elements that look alike are read as working alike. Give each role one look and keep it everywhere: every link styled the same, every destructive action in one style, every card of a type with the same anatomy. Things that work differently look different. Why: a pattern learned once works everywhere, and an odd one out reads as a bug.
A shared container or a connecting line groups more strongly than proximity or similarity. Tie a label, its value and its action together with one background or border, join the steps of a stepper or timeline with a line, and never put unrelated items in one container. Why: an edge around things says "these are one" before anything else does.
People read a layout in its simplest possible form. Before adding a border, divider, card or icon, check whether spacing and alignment already show the structure; if they do, leave it out. Use the fewest alignment lines, sizes and colours that do the job, and simple, regular shapes. Why: every extra container is one more thing to read before the content.
The bigger and closer a target, the faster it's hit. The primary action is the largest target and sits nearest where the pointer or thumb already is: beside the field it submits, at the bottom of the screen on a phone. Destructive actions sit away from it, so a miss can't trigger them, and in a confirmation for one, Cancel takes the default focus.
Enlarge the tap areas for small buttons. Every target is at least 44×44px on touch, 40×40px where the only input is a mouse. When the visual has to stay small (16–24px icons, close buttons, checkboxes, slider thumbs), grow the clickable area with a pseudo-element, never the visual:
.tiny-button { position: relative; }
.tiny-button::before {
content: "";
position: absolute;
inset: 50% auto auto 50%;
width: max(100%, 44px); /* 40px where the only input is a mouse */
height: max(100%, 44px);
translate: -50% -50%;
}
Where two grown areas would overlap, shrink both equally, never below 24×24px (WCAG 2.2's floor); if they still overlap, space the items apart. When a whole row acts as one link, the whole row is the target. Why: people aim at the centre and land near it, and 44px is the size Apple and WCAG both give a comfortable target, so an area bigger than the icon absorbs the miss.
Decision time grows with the number of choices. For options people weigh against each other (plans, sort orders, settings, onboarding choices), cut the ones few people pick and keep each group to 7 or fewer under a heading, so people pick a group and then an item. Put search first when people already know what they want (command palettes, country and font pickers). One decision per step in onboarding and checkout. Mark one option as recommended only when you have a real recommendation, and never pre-select anything that costs money or shares data. Why: comparing slows down with every option, while a search doesn't care how long the list is.
Working memory holds a handful of items, so chunk anything people read, compare or type that runs past 5 units: card numbers by scheme (4-4-4-4, Amex 4-6-5), phone numbers in their national format, one-time codes as 3 + 3, long forms in sections of at most 5 fields, top-level navigation at 7 items or fewer. Fixed-pattern numbers format as people type. Never make people carry something from one screen to the next; show it where it's needed. Why: a chunk counts as one item, so 16 digits become 4.
People spend most of their time in other products and expect yours to work the same way. Keep the conventions: the logo top left links home, account and cart sit top right, ⌘K or Ctrl+K opens the command palette, Esc closes the top layer, Enter submits a one-field form, a swipe from the left edge goes back on iOS, a magnifier means search, and links look like links. Put the novelty in the content and the craft, not in where things live or what gestures do. If you must break a convention, teach it the first time and keep the usual path working. Why: every broken convention costs people a moment of relearning, every time.
Accept messy input and give back one clean format. A date picked from a range you know (a delivery day, a booking) uses a picker limited to valid days. Anything people type from what they already know (a birthday, a phone or card number, an email) is a text field that parses every common form: "15 jan 2026", "2026-01-15" and "1/15/26" in their locale, numbers with spaces, dashes or brackets, emails with stray spaces or capitals, pasted values with trailing whitespace. Free-form values show back normalized on blur ("Thursday, 15 January 2026"). Validate on blur or submit, never while someone is still typing a field for the first time; once an error shows, re-check on every keystroke so it clears the moment it's fixed. When parsing truly fails, keep what they typed and name the format that works, with an example. Why: a strict format moves your work onto the person.
Every task carries complexity that can't be removed, only moved, so the product takes it on. Pre-fill what you can infer (the country from the account or locale, the city from the postcode, the name and email from the account), default every choice to what most people pick, and never ask for something you already know. When an option costs extra or shares data, the default is the free, private one (standard delivery, sharing off). Why: whatever the product doesn't absorb, every person pays for, every time.
A task expands to fill the time it's given, so shrink the time. Turn on autofill (autocomplete attributes), remember last-used values, offer the common answer as one tap, and keep optional fields off the main path. Say up front how long a long task takes ("About 2 minutes"). Why: every extra field is an invitation to deliberate.
Of two designs that both work, ship the one with fewer parts, and delete every element and step that doesn't serve the task. This is the cut in step 2 of "Run it", done before any polish. Then reveal complexity gradually: show the options most people need, put the rest behind "More options" or an expander, and show a follow-up field only once the answer that needs it is given. Never hide something most visits need. Why: complexity shown before it's needed is complexity everyone pays for.
Most use comes from a few features. Find them (from usage data, or from the product's core task) and give them the prime spots, the defaults and the first polish; move the rest one level down. Why: polish spread evenly is mostly spent where few people look.
Why: an error that can't happen costs nobody anything, and one people can undo costs them a second.
Unfinished tasks stay on people's minds, and people speed up as a goal gets close. Show where they are and what's left ("Step 2 of 4", "3 fields left", a checklist with finished items ticked), save partial progress, and offer to continue where they stopped. Count work already done: a step the person finished (creating the account) shows as done, and progress never reads 0% once they've done something. A step progress bar grows from its last value and never moves backward (progress bar). Why: visible remaining work pulls people back, and a goal that looks close gets finished.
People judge an experience by its most intense moment and by its end. End every flow on a confirmation that says what happened and what comes next, never on a bare redirect. Save celebration for real milestones (the rare moments in question 1); routine completions get a quiet confirmation. Fix the worst moment (an error, a long wait) before polishing an average one. Why: the end is what people remember and tell others about.
Run every check you can: if the page runs as it is (open the file, or use a dev server that's already up), check it there. Don't build a harness or scaffolding to make something runnable; in a code-only review, list after the findings the checks you couldn't run and what each would catch.
prefers-reduced-motion: reduce; in Motion, <MotionConfig reducedMotion="user"> around the app, since its default is "never"): nothing moves, scales or rotates, and nothing plays by itself (video, animated images, smooth scrolling). Opacity and colour changes stay, so a slide becomes a fade and a roll or a morph a cross-fade in place. A loop stops on its most telling frame. Every end state is the same as with motion on, and only an indicator of work in progress (a spinner, a progress bar) keeps moving, because a frozen one looks like a hang. Why: movement makes some people sick, but a fade still explains the change.Appeal is what you get when everything above holds. You can't add it at the end, only fail to lose it. Final pass: one set of named curves and durations used everywhere, every state designed (empty, loading, error, success, offline), and nothing appears from nowhere.
README.md (opens in a new tab)evals/no-trigger-pixel-art/graders/not-fired.md (opens in a new tab)evals/no-trigger-pixel-art/prompt.md (opens in a new tab)evals/outcome-editor-review/case.yaml (opens in a new tab)evals/outcome-editor-review/fixtures/editor.css (opens in a new tab)evals/outcome-editor-review/fixtures/editor.html (opens in a new tab)evals/outcome-editor-review/graders/findings.md (opens in a new tab)evals/outcome-editor-review/graders/tooltips.md (opens in a new tab)evals/outcome-editor-review/prompt.md (opens in a new tab)evals/trigger-add-to-cart/graders/fired.md (opens in a new tab)evals/trigger-add-to-cart/prompt.md (opens in a new tab)evals/trigger-dropdown-open/graders/fired.md (opens in a new tab)evals/trigger-dropdown-open/prompt.md (opens in a new tab)examples/add-to-bag.webp (opens in a new tab)references/recipes.md (opens in a new tab)references/techniques.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
ui-animation, motion-design, framer-motion, css-transitions, ux-laws
8 skills in this plugin
/charles-color-analysisCritiques the colour of a visual or palette with measurements: routes by what it's for (graphic, landing page, app, palette), measures area, lightness, hue gaps, chroma, temperature and contrast, and ranks fixes in exact OKLCH and hex with before/after previews. Use when colours clash or feel muddy, garish or off, when asked whether a palette or accent works, or to check someone's colour critique./charles-create-graphicsMakes posters and stamps that look printed, from real plates and photographs with live type: botanical, space age (NASA photos), Japanese Swiss (a red sun), neo-Swiss (grotesk, grain), sports micrographics (a giant number, tiny technical marks) or two looks fused, with foil or chrome on request. Use for a botanical, space, Japanese, Swiss, brutalist or sports poster, two styles in one poster, or a stamp. Not for a one-idea brand poster, a logo or a screen./charles-design-principles/design:charles-ux-animationfrom design
npx claudepluginhub lemonface0309/charles-skills --plugin designOther plugins' skills for the same job