Agent skill Web motion
Motion Patterns
Design, implement or review motion on the web.
Install the skill
Run the command from your project root with Node.js and npm.
npx skills@latest add affaan-m/everything-claude-code --skill motion-patterns --agent claude-code --yesCheck this file in your project.claude/skills/motion-patterns/SKILL.md
Other ways to install
Choose an assistant interactively
npx skills@latest add affaan-m/everything-claude-code --skill motion-patternsSelect your assistant and choose the project installation scope.
Official instructions
The tested Skills CLI 1.10.0 requires Node.js 22.20 or later. React with the current motion package and an existing card. The installed Skill shows examples but does not add application tokens or motion components.
View operation manualWhat this skill helps with
- Design, implement or review motion on the web.
Good for
- Web motion and transitions
- Publisher
- affaan-m
- Control points
- layout · layout="position" · AnimatePresence · aria-expanded
- Result
- An accessible expanding card with persistent control state and verified collapse cleanup.
- Skill name
motion-patterns- Repository
affaan-m/everything-claude-code
Common pitfall
Avoid this prompt
Keep the body open in layout and only collapse its image with scaleY: 0.
A transform does not collapse document flow and invisible descendants can still be reachable.
Use these steps
- Inspect the original target
- Apply the documented technique
- Verify the result in the project
Project walkthrough
Expand one original card using measured layout motion and a real disclosure control.
Expand one original card using measured layout motion and a real disclosure control.
Inspect the original target
Inspect the original target
Prompt · Step 1Use Motion Patterns on [my reading note card]. Read the Expanding card example. Find the real disclosure button, title, optional note link, and card’s resting dimensions. Decide what should reflow on open and which control keeps focus on close.Apply the documented technique
Apply the documented technique
Prompt · Step 2Use a semantic button with aria-expanded to toggle the body. Add layout to the card in normal motion and layout="position" to a stable title if needed. Put the conditional body inside a persistent AnimatePresence with a stable key and a short opacity exit. While exiting, make body controls inert and detach the body after exit. In reduced motion, disable layout animation and update the disclosure immediately.Verify the result in the project
The card expands and collapses in layout while the stable trigger remains available.
- The card expands and collapses in layout while the stable trigger remains available.
Prompt · Step 3Open and close the card from the keyboard, and reopen while the exit is in progress. Confirm button focus and aria-expanded, real card height once settled, and that collapsed links are no longer reachable. Open a fresh view with reduced motion and repeat without spatial travel.
Implementation lookup
Find the documented controls and a way to test the implementation.
Check the values and controlsInputs
- Command or reference
layout · layout="position" · AnimatePresence · aria-expanded- Examples
- The card expands and collapses in layout while the stable trigger remains available.
FAQ
Why keep a real button inside the animated card?
The button provides native keyboard input and carries the expanded state while the surrounding card handles visual movement.
Where are the examples?
Start with the installed SKILL.md and open any linked rule or reference file listed by this walkthrough.