framer-motion-layout
Skill1 starsChanged 3 months agoMITView on GitHub
Framer Motion skill for layout animations — shared layout transitions, layoutId, exit animations, AnimatePresence. Use when building shared element transitions, layout animations, reorderable lists, or when asking about Framer Motion layout, layoutId, or shared transitions.
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- C-Jeril/framer-motion-skillsedited, first seen Mar 21, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- C-Jeril/framer-motion-skills★ 899% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository138 other files it gives its agents.
- design-loopSkill
- landing-pageSkill
- product-showcaseSkill
- web-artifacts-builderSkill
- apple-designSkill
- better-colorsSkill
- better-interfaceSkill
- better-layoutSkill
- better-typographySkill
- better-uiSkill
- color-paletteSkill
- design-first-ui-promptingSkill
- design-reviewSkill
- design-systemSkill
- frontend-design-anchorsSkill
- frontend-designSkill
- theme-factorySkill
- animated-component-librariesSkill
- build-awwwards-quality-sitesSkill
- frontend-ui-engineeringSkill
- react-nativeSkill
- react-patternsSkill
- shadcn-uiSkill
- tailwindcssSkill
- tailwind-theme-builderSkill
- better-accessibilitySkill
- browser-testing-with-devtoolsSkill
- onboarding-uxSkill
- performance-optimizationSkill
- responsiveness-checkSkill
- ux-auditSkill
- ux-compareSkill
- ux-extractSkill
- vitestSkill
- webapp-testingSkill
- ai-image-generatorSkill
- algorithmic-artSkill
- favicon-genSkill
- icon-set-generatorSkill
- image-processingSkill
- seo-local-businessSkill
- wordpress-elementorSkill
- agent-harness-constructionSkill
- agent-introspection-debuggingSkill
- agent-self-evaluationSkill
- deep-diveSkill
- eval-harnessSkill
- llm-integrationSkill
- mcp-builderSkill
- prompt-engineeringSkill
- prompt-optimizerSkill
- safety-guardSkill
- search-firstSkill
- senior-prompt-engineerSkill
- skill-scoutSkill
- d1-migrationSkill
- database-schema-designerSkill
- db-seedSkill
- sql-database-assistantSkill
- git-workflowSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 58
When CardA unmounts and CardB mounts with the same layoutId, Framer Motion animates the element smoothly between positions.
- Distinctive: line 200
When multiple elements share a layoutId at the same level:
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Framer Motion Layout Animations
When to Use This Skill
Apply when implementing shared element transitions, layout animations for reordering, or coordinated mount/unmount animations. When the user asks about Framer Motion layout animations, layoutId, or AnimatePresence.
Related skills: For core animation use framer-motion-core; for variants use framer-motion-variants; for React integration use framer-motion-react.
Layout Prop
The layout prop enables automatic position animations when layout changes:
<motion.div layout>
{items.map(item => (
<motion.div key={item.id} layout />
))}
</motion.div>Layout Modes
| Mode | Behavior |
true | Animate position and size |
"position" | Animate only position |
"size" | Animate only size |
<motion.div layout="position" />
<motion.div layout="size" />layoutId for Shared Element Transitions
layoutId enables smooth transitions between elements in different components:
Page Transitions
// Page A
function CardA() {
return <motion.div layoutId="card" />;
}
// Page B
function CardB() {
return <motion.div layoutId="card" />;
}When CardA unmounts and CardB mounts with the same layoutId, Framer Motion animates the element smoothly between positions.
Modal Overlays
function ListItem({ item, onClick }) {
return (
<motion.div layoutId={`item-${item.id}`} onClick={onClick}>
{item.name}
</motion.div>
);
}
function Modal({ item }) {
return (
<motion.div layoutId={`item-${item.id}`}>
<h2>{item.name}</h2>
<p>{item.description}</p>
</motion.div>
);
}AnimatePresence for Layout
AnimatePresence enables exit animations:
import { AnimatePresence, motion } from "framer-motion";
function TodoList({ todos }) {
return (
<motion.ul>
<AnimatePresence>
{todos.map(todo => (
<motion.li
key={todo.id}
layout
initial={{ opacity: 0, x: -20 }}
animate={{ opacity: 1, x: 0 }}
exit={{ opacity: 0, x: 20 }}
/>
))}
</AnimatePresence>
</motion.ul>
);
}AnimatePresence Modes
<AnimatePresence mode="wait">
{isOpen && <Modal key="modal" />}
</AnimatePresence>| Mode | Description |
"sync" | All animations run simultaneously (default) |
"wait" | Exit completes before enter starts |
"popLayout" | Exiting element removed from layout immediately |
Reorderable Lists
Combine layout with drag for reorderable lists:
function ReorderableList({ items, setItems }) {
return (
<AnimatePresence>
{items.map(item => (
<motion.div
key={item.id}
layout
drag
dragConstraints={{ top: 0, bottom: 0 }}
onDragEnd={({ info, target }) => {
// Calculate new index and update
}}
initial={{ opacity: 0, scale: 0.8 }}
animate={{ opacity: 1, scale: 1 }}
exit={{ opacity: 0, scale: 0.8 }}
/>
))}
</AnimatePresence>
);
}Shared Layout with Grid
function Grid({ items }) {
return (
<motion.div
layout
style={{
display: "grid",
gridTemplateColumns: "repeat(auto-fill, minmax(100px, 1fr))",
gap: 10
}}
>
{items.map(item => (
<motion.div
key={item.id}
layout
style={{
width: "100%",
aspectRatio: 1,
backgroundColor: item.color
}}
/>
))}
</motion.div>
);
}Exit Animations
Elements must have exit states for AnimatePresence:
<motion.div
initial={{ opacity: 0, scale: 0 }}
animate={{ opacity: 1, scale: 1 }}
exit={{ opacity: 0, scale: 0 }}
/>Exit with layout
<motion.div
layout
exit={{ opacity: 0, x: -100, transition: { duration: 0.3 } }}
/>Crossfade with layoutId
When multiple elements share a layoutId at the same level:
function Toggle() {
const [showA, setShowA] = useState(true);
return (
<AnimatePresence mode="popLayout">
{showA ? (
<motion.div
key="a"
layoutId="shape"
style={{ backgroundColor: "red" }}
/>
) : (
<motion.div
key="b"
layoutId="shape"
style={{ backgroundColor: "blue", borderRadius: "50%" }}
/>
)}
</AnimatePresence>
);
}The element smoothly morphs between states including border radius.
Best practices
- ✅ Use layoutId for shared element transitions between routes/pages.
- ✅ Wrap animated lists with AnimatePresence for exit animations.
- ✅ Use layout prop for automatic position animations.
- ✅ Use AnimatePresence mode="popLayout" for smooth reordering.
- ✅ Define exit states for components using AnimatePresence.
- ✅ Use layout on parent containers when children need to animate position.
Do Not
- ❌ Forget to wrap conditionally rendered animated components with AnimatePresence.
- ❌ Use the same layoutId on multiple elements at the same level.
- ❌ Forget to define exit states for components that unmount.
- ❌ Use layout animations without proper keys on children.
- ❌ Animate too many layout elements simultaneously — group or stagger.
Learn More
https://www.framer.com/motion/layout-animations/ https://www.framer.com/motion/animate-presence/
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

