Skip to content
Back to skills

Ztx14 Best Motion Exit Presence

ASecurity

Use Motion presence patterns to animate conditional React content while keeping keys and state transitions correct.

  • 14 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 7, 2026
developmentreactapi

Works with

  • api

Security analysis

A100/100

Scanned November 7, 2026

npx -y skills add Realjustawall/Perfect-AI --skill ztx14-best-motion-exit-presence --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ztx14 Best Motion Exit Presence?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ztx14 Best Motion Exit Presence
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/realjustawall-ztx14-best-motion-exit-presence/badge)](https://www.skillsdirectory.com/skills/realjustawall-ztx14-best-motion-exit-presence)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ztx14-best-motion-exit-presence
description: Use Motion presence patterns to animate conditional React content while keeping keys and state transitions correct.
---

# Animate enter/exit without leaving stale DOM or state

> Best-practice implementation skill. Inspect the real project, installed package versions, current component contract, and existing animation ownership before changing code. This skill adds guidance only; it does not install dependencies by itself.

## When to use
Panels, tooltips, menus, object details, modals, badges, and route-adjacent overlays whose exit should finish after state changes.

## Procedure
1. Give each rendered item a stable identity key; distinguish replacement from the same item’s internal state update.
2. Wrap conditional children in `AnimatePresence` when the exit animation must run after React removes the child from the render tree.
3. Define a short, coherent exit state and make sure it does not block interaction with the next active element.
4. Keep semantic visibility and focus ownership in React; animation completion should not be the only authority for whether an item is accessible.
5. Handle rapid close/reopen and replacement scenarios; test interrupted transitions and stale callbacks.
6. For server-rendered or initially present content, explicitly decide whether the first mount should animate.

## Avoid
- Do not use array index keys for reorderable or interactive objects.
- Do not leave invisible exiting elements keyboard-focusable or pointer-intercepting.
- Do not use `setTimeout` as a substitute for presence lifecycle events.

## Acceptance checks
- [ ] Rapid reopen and replacement have deterministic results.
- [ ] Exited content no longer traps focus or pointer input.
- [ ] Initial-motion behavior is intentional.

## Primary references
- https://motion.dev/docs/react-animate-presence
- https://motion.dev/docs/react

## Reporting requirement
State which files were inspected, what changed, and which checks actually ran. Do not claim a browser/device was verified unless it was tested.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.