Skip to content
Back to skills

Interaction Design

ASecurity

Microinteractions, transitions and feedback states with Motion, GSAP or CSS. Use for press and hover feedback, loading, toasts, page transitions, drag gestures and scroll-driven animation.

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 16, 2026
ai-agentsgoreactspringapiperformance

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned October 16, 2026

npx -y skills add hsynozdamar-byte/claude-skills-edited --skill interaction-design --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Interaction Design?

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

Security grade badge for Interaction Design
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hsynozdamar-byte-interaction-design/badge)](https://www.skillsdirectory.com/skills/hsynozdamar-byte-interaction-design)

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: interaction-design
description: "Microinteractions, transitions and feedback states with Motion, GSAP or CSS. Use for press and hover feedback, loading, toasts, page transitions, drag gestures and scroll-driven animation."
---

# Interaction Design

Motion should communicate, not decorate: confirm an action happened (feedback), show where things come from and go to (orientation), pull attention to what changed (focus), and keep context across a change (continuity). Too much motion causes fatigue.

## Timing and easing

| Duration | Use |
| --- | --- |
| 100-150ms | Micro-feedback (hover, click) |
| 200-300ms | Toggles, dropdowns |
| 300-500ms | Modals, page changes |
| 500ms+ | Choreographed sequences |

Use one timing scale across the app.

```css
--ease-out: cubic-bezier(0.16, 1, 0.3, 1);     /* entering */
--ease-in: cubic-bezier(0.55, 0, 1, 0.45);     /* exiting */
--ease-in-out: cubic-bezier(0.65, 0, 0.35, 1); /* moving between */
--spring: cubic-bezier(0.34, 1.56, 0.64, 1);   /* overshoot, playful */
```

## Spring values that work (Motion)

- Button press/hover: `whileTap={{ scale: 0.98 }}`, `whileHover={{ scale: 1.02 }}`, `{ type: "spring", stiffness: 400, damping: 17 }`.
- Toggle thumb and `layoutId` active indicators (tabs, nav pills): `stiffness: 500, damping: 30`.
- Smoothed scroll progress: `useSpring(scrollYProgress, { stiffness: 100, damping: 30, restDelta: 0.001 })`.
- Presets (stiffness/damping, mass 1): default 170/26, gentle 120/14, wobbly 180/12, stiff 210/20, slow 280/60, molasses 280/120. Higher stiffness is snappier, higher damping less bouncy.

## Gotchas

- Animate `transform` and `opacity`; not `width`, `height`, `top`, `left`, `margin`, `padding`.
- Swapping content in place (button label to spinner, count change): `AnimatePresence mode="wait"` with a changing `key` on the child, or the exit never plays.
- Page transitions: `AnimatePresence mode="wait" initial={false}` keyed on the pathname, so the first load doesn't animate.
- Shared active indicator: render it only in the active item with a common `layoutId`; Motion animates it between positions. `Reorder.Group`/`Reorder.Item` for drag-to-reorder lists.
- Stagger with variants: parent `staggerChildren: 0.1, delayChildren: 0.2`, children carry their own `hidden`/`visible`.
- GSAP in React: create tweens inside `gsap.context(() => {...}, scopeRef)` in `useLayoutEffect` and return `() => ctx.revert()`. `gsap.registerPlugin(ScrollTrigger)` (and `SplitText`) before use; revert `SplitText` on cleanup. Use `ease: "none"` with `scrub` for parallax.
- View Transitions: guard `document.startViewTransition`; give morphing elements a unique `viewTransitionName` per item (e.g. `product-${id}`).
- Scroll: listeners with `{ passive: true }`; prefer `IntersectionObserver` (or `useInView` with once) over scroll handlers for reveals. `will-change` sparingly.
- Optimistic updates: update UI immediately, roll back on error.
- Never block input while an animation plays; let users interrupt long ones. Clean up timers, observers and animations on unmount (`animation.cancel()` for WAAPI).
- Skeletons should match the final layout so nothing shifts when content arrives.
- Reduced motion: respect `prefers-reduced-motion`; with JS, also listen for `change` on the media query rather than reading it once. Drop the movement offset (`y: 0`) and duration rather than the whole state change.
- Test on real devices; performance varies a lot.

For ready-made recipes with their tuned values (loading/success buttons, shake on error, click-again confirm, toasts, pull to refresh, parallax, horizontal scroll, text and clip reveals, Lenis, scroll snap), load `references/patterns.md`.

Files in this skill

  • SKILL.md3.6 KB
  • SOURCE.md357 B
  • references/patterns.md3.5 KB

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.