react-spring — скилл для Claude Code: 12 принципов анимации
Скилл показывает, как собрать все 12 принципов анимации Disney на физике пружин React Spring — с готовыми примерами под каждый принцип.
npx skills add dylantarre/animation-principles --skill react-spring -a claude-codeЧто делает react-spring
Скилл разбирает 12 принципов анимации Disney и даёт под каждый рабочий пример на React Spring. Squash and stretch, anticipation, staging, follow through, slow in and slow out, arc, exaggeration — всё через useSpring и его конфиг. Примеры не абстрактные: в них указаны конкретные значения tension и friction, поэтому можно взять код и сразу подставить в компонент.
Внутри — не только useSpring. Есть useTrail для каскадных появлений списка, а также перечислены useSprings, useChain и useTransition для монтирования и размонтирования. Отдельный блок про тайминг: пресеты gentle, stiff, slow, molasses и таблица конфигов fast, normal, slow, wobbly. Логика такая: высокая tension с низкой friction даёт резкое движение, низкая tension с высокой friction — плавное.
Скилл рассчитан на React-проекты, где уже стоит React Spring. Если библиотеки в проекте нет, примеры не запустятся — ставьте её отдельно. Для Cursor и Codex файл кладётся в .cursor/skills/react-spring/SKILL.md и .agents/skills/react-spring/SKILL.md соответственно, для Claude — в ~/.claude/skills/react-spring/SKILL.md.
Какие задачи решает
- собрать squash and stretch на пружинах вместо CSS-кейфреймов
- добавить замах перед прыжком через anticipation
- развести главный и второстепенный объект по глубине резкости
- выстроить каскад появления элементов списка через useTrail
- подобрать tension и friction под нужную скорость движения
Примеры запросов агенту
- покажи, как сделать squash and stretch на useSpring
- нужен замах перед прыжком — пример anticipation на React Spring
- сделай каскадное появление карточек через useTrail
Как установить react-spring
1Через Skills CLI (Vercel)
npx skills add dylantarre/animation-principles --skill react-spring -a claude-code2Вручную: положить файлы
~/.claude/skills/react-spring/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/react-spring/
1Через Skills CLI (Vercel)
npx skills add dylantarre/animation-principles --skill react-spring -a codex2Вручную: положить файлы
.agents/skills/react-spring/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add dylantarre/animation-principles --skill react-spring -a cursor2Вручную: положить файлы
.cursor/skills/react-spring/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install dylantarre/animation-principles react-spring2Вручную: положить файлы
.github/skills/react-spring/SKILL.md1Через Skills CLI (Vercel)
npx skills add dylantarre/animation-principles --skill react-spring -a gemini-cli2Командой платформы
gemini skills install https://github.com/dylantarre/animation-principles --path skills/09-by-tool-framework/react-springВручную: положить файлы
.devin/skills/react-spring/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add dylantarre/animation-principles --skill react-spring -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о react-spring
Как установить react-spring в Claude?
Выполните npx skills add dylantarre/animation-principles --skill react-spring -a claude-code. Файл скилла появится по пути ~/.claude/skills/react-spring/SKILL.md.
Что делает скилл react-spring?
Разбирает 12 принципов анимации Disney и даёт под каждый пример кода на React Spring: useSpring, useTrail, конфиги tension и friction.
Какие хуки React Spring описаны в скилле?
useSpring для одной анимации, useSprings для нескольких, useTrail для каскада, useChain для последовательности и useTransition для монтирования и размонтирования.
Исходный текст
SKILL.md · MIT
---
name: react-spring
description: Use when implementing Disney's 12 animation principles with React Spring's physics-based animations
---
# React Spring Animation Principles
Implement all 12 Disney animation principles using React Spring's spring physics system.
## 1. Squash and Stretch
```jsx
const [springs, api] = useSpring(() => ({
scaleX: 1,
scaleY: 1,
config: { tension: 300, friction: 10 }
}));
api.start({ scaleX: 1.2, scaleY: 0.8 });
<animated.div style={springs} />
```
## 2. Anticipation
```jsx
const [props, api] = useSpring(() => ({ y: 0, scaleY: 1 }));
const jump = async () => {
await api.start({ y: 10, scaleY: 0.9 }); // wind up
api.start({ y: -200, config: { tension: 200 } }); // action
};
```
## 3. Staging
```jsx
const bgSpring = useSpring({ filter: 'blur(3px)', opacity: 0.6 });
const heroSpring = useSpring({ scale: 1.1, zIndex: 10 });
```
## 4. Straight Ahead / Pose to Pose
```jsx
const [props] = useSpring(() => ({
from: { x: 0, y: 0 },
to: [
{ x: 100, y: -50 },
{ x: 200, y: 0 },
{ x: 300, y: -30 }
]
}));
```
## 5. Follow Through and Overlapping Action
```jsx
const bodySpring = useSpring({ x: 200 });
const hairSpring = useSpring({ x: 200, delay: 50 });
const capeSpring = useSpring({ x: 200, delay: 100, config: { friction: 15 } });
```
## 6. Slow In and Slow Out
```jsx
const spring = useSpring({
x: 300,
config: {
tension: 170,
friction: 26 // balanced = smooth in/out
}
});
// High tension + low friction = fast
// Low tension + high friction = slow
```
## 7. Arc
```jsx
const [props] = useSpring(() => ({
to: async (next) => {
await next({ x: 100, y: -100 });
await next({ x: 200, y: 0 });
},
config: { tension: 200, friction: 20 }
}));
```
## 8. Secondary Action
```jsx
const buttonSpring = useSpring({ scale: hover ? 1.05 : 1 });
const iconSpring = useSpring({
rotate: hover ? 15 : 0,
delay: 50
});
```
## 9. Timing
```jsx
const configs = {
fast: { tension: 400, friction: 30 },
normal: { tension: 170, friction: 26 },
slow: { tension: 100, friction: 40 },
wobbly: { tension: 180, friction: 12 }
};
// Or use presets: config.gentle, config.stiff, config.slow
```
## 10. Exaggeration
```jsx
const spring = useSpring({
scale: 1.5,
rotate: 720,
config: { tension: 200, friction: 8 } // low friction = overshoot
});
```
## 11. Solid Drawing
```jsx
const spring = useSpring({
transform: 'perspective(1000px) rotateX(45deg) rotateY(30deg)'
});
```
## 12. Appeal
```jsx
const cardSpring = useSpring({
scale: hover ? 1.02 : 1,
boxShadow: hover
? '0 20px 40px rgba(0,0,0,0.2)'
: '0 5px 15px rgba(0,0,0,0.1)',
config: config.gentle
});
```
## useTrail for Stagger
```jsx
const trail = useTrail(items.length, {
opacity: show ? 1 : 0,
y: show ? 0 : 20,
config: { tension: 200, friction: 20 }
});
trail.map((props, i) => <animated.div style={props}>{items[i]}</animated.div>)
```
## Key React Spring Features
- `useSpring` - Single animation
- `useSprings` - Multiple springs
- `useTrail` - Staggered animations
- `useChain` - Sequence animations
- `useTransition` - Mount/unmount animations
- `config` presets - `gentle`, `stiff`, `slow`, `molasses`
- Physics-based: `tension`, `friction`, `mass`, `velocity`
© dylantarre · MIT · dylantarre/animation-principles