·mastering-animate-presence
</>

mastering-animate-presence

raphaelsalaja/userinterface-wiki

使用 Motion 的 AnimatePresence 组件实现退出动画的指南。当对离开 DOM 的元素进行动画处理、协调嵌套退出或管理存在状态时使用。触发涉及 React 退出动画、卸载转换或运动库模式的任务。

106安装·0热度·@raphaelsalaja

安装

$npx skills add https://github.com/raphaelsalaja/userinterface-wiki --skill mastering-animate-presence

SKILL.md

When elements leave the DOM, they're gone—no way to animate something that doesn't exist. Motion's AnimatePresence solves this by keeping departing elements mounted long enough to animate out.

| AnimatePresence | Wrapper that enables exit animations | | useIsPresent | Hook to read if component is exiting | | usePresence | Hook for manual exit control with safeToRemove | | propagate | Prop to enable nested exit animations | | mode | Controls timing between enter/exit (sync, wait, popLayout) |

Use useIsPresent when a component needs to know it's exiting:

使用 Motion 的 AnimatePresence 组件实现退出动画的指南。当对离开 DOM 的元素进行动画处理、协调嵌套退出或管理存在状态时使用。触发涉及 React 退出动画、卸载转换或运动库模式的任务。 来源:raphaelsalaja/userinterface-wiki。

查看原文

可引用信息

为搜索与 AI 引用准备的稳定字段与命令。

安装命令
npx skills add https://github.com/raphaelsalaja/userinterface-wiki --skill mastering-animate-presence
分类
</>开发工具
认证
收录时间
2026-02-01
更新时间
2026-02-18

快速解答

什么是 mastering-animate-presence?

使用 Motion 的 AnimatePresence 组件实现退出动画的指南。当对离开 DOM 的元素进行动画处理、协调嵌套退出或管理存在状态时使用。触发涉及 React 退出动画、卸载转换或运动库模式的任务。 来源:raphaelsalaja/userinterface-wiki。

如何安装 mastering-animate-presence?

打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等) 复制并运行以下命令:npx skills add https://github.com/raphaelsalaja/userinterface-wiki --skill mastering-animate-presence 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code 或 Cursor 中使用

这个 Skill 的源码在哪?

https://github.com/raphaelsalaja/userinterface-wiki