page-transitions — Claude Code skill: route and modal animation
A skill for animating route changes, view transitions and modal opens. It gives the agent timings and easing curves instead of guesswork.
npx skills add dylantarre/animation-principles --skill page-transitions -a claude-codeWhat page-transitions does
The skill maps Disney's twelve animation principles onto route changes, view transitions and navigation. Inside you get a principle-to-implementation table, ready CSS patterns for crossfade, slide and shared element, a timing reference and a navigation pattern table.
The agent gets specifics. Exit runs on ease-in, enter on ease-out, and linear easing is called out as feeling broken. Durations are split by type: crossfade 200-300ms, slide forward 300-400ms, modal open 250-350ms, tab switch 150-200ms. The shared element example uses the View Transitions API with document.startViewTransition and view-transition-name.
The performance section says to animate transform and opacity only, and to test transitions on slow devices. If your project already has an animation system, the timings here need reconciling with it — two sets of curves fighting each other is a real risk.
What it helps with
- pick a duration and easing curve for a route change
- carry context from a list view into a detail view
- animate modal open and close
- make back navigation faster than forward
- move a transition onto the View Transitions API
Example prompts for the agent
- Animate the transition from the product list to the detail card with a shared element, 300ms
- Add a modal open animation with scale and fade, ease-out
- Rewrite the tab switch to use transform and opacity, drop the layout property animation
How to install page-transitions
1Skills CLI (Vercel)
npx skills add dylantarre/animation-principles --skill page-transitions -a claude-code2Manually: put the files in place
~/.claude/skills/page-transitions/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/page-transitions/
1Skills CLI (Vercel)
npx skills add dylantarre/animation-principles --skill page-transitions -a codex2Manually: put the files in place
.agents/skills/page-transitions/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add dylantarre/animation-principles --skill page-transitions -a cursor2Manually: put the files in place
.cursor/skills/page-transitions/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install dylantarre/animation-principles page-transitions2Manually: put the files in place
.github/skills/page-transitions/SKILL.md1Skills CLI (Vercel)
npx skills add dylantarre/animation-principles --skill page-transitions -a gemini-cli2Platform CLI
gemini skills install https://github.com/dylantarre/animation-principles --path skills/01-by-domain/page-transitionsManually: put the files in place
.devin/skills/page-transitions/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add dylantarre/animation-principles --skill page-transitions -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about page-transitions
How do I install page-transitions in Claude?
Run npx skills add dylantarre/animation-principles --skill page-transitions -a claude-code. The skill file then lives at ~/.claude/skills/page-transitions/SKILL.md.
What does page-transitions do?
It tells the agent how to animate route changes, views and modals: which principles apply, what timings and curves to use, and which navigation patterns fit.
Which platforms does the skill support?
Claude, Codex, Cursor, GitHub Copilot, Gemini CLI and OpenCode. Each platform has its own install command and skill file path.
Source text
SKILL.md · MIT
---
name: page-transitions
description: Use when implementing route changes, view transitions, modal opens/closes, or navigation animation in web and mobile applications.
---
# Page Transition Animation
Apply Disney's 12 animation principles to route changes, view transitions, and navigation patterns.
## Quick Reference
| Principle | Page Transition Implementation |
|-----------|-------------------------------|
| Squash & Stretch | Entering page elastic effect |
| Anticipation | Exit animation before enter |
| Staging | Hero elements bridge views |
| Straight Ahead / Pose to Pose | Shared element vs crossfade |
| Follow Through / Overlapping | Content settles after nav |
| Slow In / Slow Out | Asymmetric enter/exit easing |
| Arc | Slide transitions with curve |
| Secondary Action | Background, nav state changes |
| Timing | 200-500ms total transition |
| Exaggeration | Reserved for emphasis moments |
| Solid Drawing | Consistent spatial model |
| Appeal | Smooth, oriented navigation |
## Principle Applications
**Squash & Stretch**: Incoming pages can have subtle elastic settle. Modal sheets bounce slightly on full open. Pull-to-navigate stretches before triggering.
**Anticipation**: Current page begins exit before new page enters. Slight fade or scale prepares for change. Navigation indicator updates before page swaps.
**Staging**: Shared/hero elements maintain context across views. Common elements (nav, footer) stay stable. New content area receives transition focus.
**Straight Ahead vs Pose to Pose**: Shared element transitions morph continuously (straight ahead). Crossfades swap between discrete states (pose to pose). Choose based on content relationship.
**Follow Through & Overlapping**: Page content settles after initial position. Staggered content entry—header, then body, then footer. Images load with subtle fade after container.
**Slow In / Slow Out**: Exit: ease-in (accelerate away). Enter: ease-out (decelerate in). Combined: ease-in-out for shared elements. Never linear—feels broken.
**Arc**: Slide transitions can curve slightly. Stack navigation implies z-depth. Circular reveals expand from trigger point.
**Secondary Action**: Header updates title during transition. Bottom nav indicator moves. Background color shifts. Scroll position resets with transition.
**Timing**: Quick transitions: 200-300ms. Standard: 300-400ms. Complex: 400-500ms. Modal/sheet: 250-350ms. Back navigation often faster than forward.
**Exaggeration**: Save exaggeration for key moments—onboarding, achievement. Regular navigation should be smooth, not theatrical. Users navigate frequently.
**Solid Drawing**: Maintain consistent spatial metaphor. If pages stack, maintain z-order. If pages slide, direction should be consistent. Users build mental model from transitions.
**Appeal**: Transitions should feel helpful, not impressive. Fast, smooth, oriented. Users should understand where they came from and went to.
## Transition Patterns
### Crossfade (Default)
```css
.page-exit {
opacity: 1;
}
.page-exit-active {
opacity: 0;
transition: opacity 200ms ease-in;
}
.page-enter {
opacity: 0;
}
.page-enter-active {
opacity: 1;
transition: opacity 200ms ease-out;
}
```
### Slide (Hierarchical)
```css
/* Forward navigation */
.page-enter {
transform: translateX(100%);
}
.page-enter-active {
transform: translateX(0);
transition: transform 300ms ease-out;
}
.page-exit-active {
transform: translateX(-30%);
transition: transform 300ms ease-in;
}
/* Back navigation - reversed */
.page-enter {
transform: translateX(-30%);
}
.page-exit-active {
transform: translateX(100%);
}
```
### Shared Element (Hero)
```javascript
// View Transitions API
document.startViewTransition(() => {
updateDOM();
});
// CSS for specific element
.hero-image {
view-transition-name: hero;
}
::view-transition-old(hero),
::view-transition-new(hero) {
animation-duration: 300ms;
}
```
## Timing Reference
| Transition Type | Duration | Exit | Enter |
|----------------|----------|------|-------|
| Crossfade | 200-300ms | ease-in | ease-out |
| Slide forward | 300-400ms | ease-in | ease-out |
| Slide back | 250-350ms | ease-in | ease-out |
| Modal open | 250-350ms | — | ease-out |
| Modal close | 200-300ms | ease-in | — |
| Shared element | 300-400ms | n/a | ease-in-out |
| Tab switch | 150-200ms | instant | ease-out |
## Navigation Patterns
| Pattern | Transition | Direction |
|---------|------------|-----------|
| Drill-down (list→detail) | Slide left / shared element | Right = forward |
| Tab bar | Fade / slide | Horizontal |
| Bottom sheet | Slide up | Vertical |
| Modal | Scale + fade | Z-axis |
| Back button | Reverse of forward | Left = back |
## Performance
1. Use `transform` and `opacity` only
2. Hardware acceleration: `will-change: transform`
3. Reduce motion: instant transitions
4. Test on slow devices—transitions must not block
5. View Transitions API: native performance
© dylantarre · MIT · dylantarre/animation-principles