Skip to main content
skill CX Codex

state-changes — Claude Code skill for UI state animations

A skill for animating elements that transform in place: toggles, accordions, checkboxes, button states. Useful when an interface needs smooth transitions without enter or exit.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add dylantarre/animation-principles --skill state-changes -a claude-code
Open on GitHub

What state-changes does

The skill maps Disney's 12 animation principles onto elements that transform without leaving the screen. Each principle gets its own note: squash before expanding, a slight wind-up before the change, parts moving at different rates, rotation along an arc. Every state type comes with a duration and an easing curve — checkbox at 150ms ease-out, toggle at 200ms ease-in-out, accordion at 250ms, card expand at 300ms.

Ready CSS patterns are included. A toggle gets transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1), while its knob uses a separate overshooting curve cubic-bezier(0.34, 1.56, 0.64, 1). The accordion is built on grid-template-rows going from 0fr to 1fr, so height animates without measuring content by hand.

The key rule: state changes are reversible. The animation toward state B should be the inverse of the one toward state A, and both directions need testing. If your toggle opens smoothly and snaps on close, that is the case this skill targets. It runs in Claude, Codex, Cursor, GitHub Copilot, Gemini CLI and OpenCode.

What it helps with

  • animate a toggle with a small overshoot at the end
  • expand an accordion without measuring content height by hand
  • pick duration and easing for a checkbox or radio button
  • make the reverse animation work when returning to the original state
  • coordinate knob movement, colour shift and icon swap

Example prompts for the agent

  • add a state animation to this toggle using the state-changes skill
  • the accordion snaps open, fix it with state-changes
  • check both directions of the button animation with state-changes

How to install state-changes

1Skills CLI (Vercel)

npx skills add dylantarre/animation-principles --skill state-changes -a claude-code

2Manually: put the files in place

~/.claude/skills/state-changes/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/state-changes/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about state-changes

How do I install state-changes in Claude?

Run npx skills add dylantarre/animation-principles --skill state-changes -a claude-code. The skill lands in ~/.claude/skills/state-changes/SKILL.md.

What does state-changes do?

It gives the agent animation rules for elements that change in place: toggles, accordions, checkboxes, buttons. Inside are the animation principles, a timing table and CSS patterns.

How is state-changes different from enter and exit animations?

It covers transformations where the element never enters or leaves. It also insists the animation be reversible: the move to state B mirrors the move to state A, and both directions get tested.

Source text

SKILL.md · MIT
---
name: state-changes
description: Use when elements transform in place - toggle switches, expanding accordions, checkbox animations, button states, or any transformation without entering/exiting.
---

# State Change Animations

Apply Disney's 12 principles when elements transform without leaving.

## Principle Application

**Squash & Stretch**: Elements compress before expanding. A toggle switch squashes 5% before sliding.

**Anticipation**: Wind up before the change. Slight reverse movement (2-3px) before expanding.

**Staging**: Keep transformations centered on user focus. Don't let state changes distract from the interaction point.

**Straight Ahead vs Pose-to-Pose**: Define exact states. Button has rest, hover, active, disabled - each precisely designed.

**Follow Through & Overlapping**: Parts transform at different rates. Icon rotates before label fades in.

**Slow In/Slow Out**: Use ease-in-out for bidirectional changes: `cubic-bezier(0.4, 0, 0.2, 1)`.

**Arcs**: Rotating elements follow natural arcs. Chevrons rotate on their center point, not linearly.

**Secondary Action**: Pair the primary change with supporting motion. Toggle sliding + color shift + icon swap.

**Timing**:
- Micro-states: 100-150ms (checkbox tick, radio fill)
- Standard states: 150-250ms (toggles, accordions)
- Complex states: 250-400ms (multi-part transformations)

**Exaggeration**: Overshoot slightly on state changes. Toggle goes 2px past, then settles.

**Solid Drawing**: Maintain element integrity during transformation. No distortion that breaks visual consistency.

**Appeal**: State changes should feel satisfying. Users clicked with intent - reward that intent.

## Timing Recommendations

| State Change | Duration | Easing | Notes |
|-------------|----------|--------|-------|
| Checkbox | 150ms | ease-out | Tick draws in |
| Toggle Switch | 200ms | ease-in-out | Overshoot slightly |
| Radio Button | 150ms | ease-out | Scale in from center |
| Accordion | 250ms | ease-in-out | Height + rotation |
| Tab Switch | 200ms | ease-in-out | Indicator slides |
| Button Active | 100ms | ease-out | Scale to 0.97 |
| Card Expand | 300ms | ease-in-out | All properties together |

## Implementation Pattern

```css
.toggle {
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-knob {
  transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1); /* Overshoot */
}

.toggle.active .toggle-knob {
  transform: translateX(20px);
}
```

## Accordion Pattern

```css
.accordion-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 250ms ease-in-out;
}

.accordion.open .accordion-content {
  grid-template-rows: 1fr;
}
```

## Key Rule

State changes are reversible. The animation to state B should be the inverse of animation to state A. Test both directions.

© dylantarre · MIT · dylantarre/animation-principles

Similar skills

Everything for Frontend and UI →

From the same set86

feedback-indicators A skill for confirmation animations: success checkmarks, error shakes, form validation and toasts. Useful when the UI has to answer back clearly. CX Codex +1 493installs Animation Principles - Troubleshooting A skill that diagnoses why an animation feels wrong and points to the principle being misapplied. Useful when the motion reads badly but the cause is unclear. CX Codex +1 490installs Animation Principles - Advanced A skill for animators who already know the fundamentals and want the nuances: invisible squash/stretch, missing anticipation, deliberately broken arcs. CX Codex +1 489installs emotional-disconnect Diagnoses why an animation feels wrong and matches motion to the emotion the moment should carry. Useful when users call your UI cold or annoying. CX Codex +1 488installs Animation Principles - Deep Dive A reference skill covering Disney's 12 animation principles with technical detail: deformation ratios, frame counts, arcs, follow through. Useful when the agent needs animation context. CX Codex +1 487installs Animation Principles - Novice A skill that walks through the 12 animation principles with a hands-on exercise for each. Useful once you know the theory and want to actually use it. CX Codex +1 488installs Animation Principles - Absolute Beginner Walks through the 12 principles of animation in plain words. Useful when you are touching motion in a UI or a game for the first time. CX Codex +1 486installs technical-constraints A skill for when animation is capped by browser support, platform capabilities or technical requirements. It keeps the intent and drops what breaks. CX Codex +1 487installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor