interaction-design
БесплатноБез исполняемых скриптовНе проверенInteraction design patterns for web interfaces. Covers motion and animation timing, microinteractions, loading states, skeleton screens, optimistic UI, form…
от claude-dev-suite★ 51 звезда на GitHubОб этом скилле
Interaction Design
Animation Timing Reference
Research-backed durations. The most common mistake is animations that are too slow.
| Interaction type | Duration | Easing | Notes |
|---|---|---|---|
| Hover state change | 80–120ms | ease-out | Opacity, color, shadow |
| Focus ring | 80ms | ease-out | Should feel instant |
| Tap/click feedback | 80–100ms | ease-out | Scale or opacity pulse |
| Toggle (checkbox, switch) | 150ms | ease-in-out | State change |
| Dropdown open | 150–200ms | ease-out | Entering |
| Dropdown close | 100–150ms | ease-in | Exiting — faster than entering |
| Modal/dialog open | 200–250ms | ease-out | Entering |
| Modal/dialog close | 150–200ms | ease-in | Exiting |
| Toast notification | 200–300ms in, 150ms out | ease-out / ease-in | |
| Page transition | 300–400ms | ease-in-out | Max for page-level |
| Hard limit | 500ms | — | Never exceed; users feel it as lag |
Easing rules:
- ease-out (
cubic-bezier(0, 0, 0.2, 1)): For elements entering the screen — starts fast, decelerates. Feels responsive. - ease-in (
cubic-bezier(0.4, 0, 1, 1)): For elements leaving — starts slow, accelerates. Feels natural. - ease-in-out (
cubic-bezier(0.4, 0, 0.2, 1)): For elements transforming within the screen. - Never use linear for UI — looks mechanical.
:root {
--ease-out: cubic-bezier(0, 0, 0.2, 1);
--ease-in: cubic-bezier(0.4, 0, 1, 1);
--ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
--duration-fast: 100ms;
--duration-normal: 200ms;
--duration-slow: 300ms;
}
prefers-reduced-motion (SAFETY-CRITICAL)
Parallax, large-scale animations, and auto-playing effects can cause nausea, dizziness, and seizures in users with vestibular disorders. This is a safety concern, not just a preference.
/* Global reduced-motion reset — add to your base CSS */
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}
For animations that serve a purpose (progress feedback), provide a reduced alternative:
.spinner {
animation: spin 1s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
.spinner {
animation: none;
/* Show a static indicator instead */
opacity: 0.5;
}
}
In React/Tailwind:
import { useReducedMotion } from "@/hooks/use-reduced-motion";
function AnimatedModal({ children }: { children: React.ReactNode }) {
const reduced = useReducedMotion();
return (
<div
className={cn(
"transition-all",
reduced ? "duration-0" : "duration-200 ease-out"
)}
>
{children}
</div>
);
}
// Hook
function useReducedMotion() {
return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
}
Loading States Decision Matrix
| Scenario | Best pattern | Avoid |
|---|---|---|
| Page / section load | Skeleton screen | Spinner |
| Button action (fast, low-risk) | Optimistic UI | Blocking overlay |
| Button action (uncertain outcome) | Loading spinner on button | Full-page overlay |
| Background data fetch | No indicator | Spinner |
| File upload | Progress bar | Spinner |
| Long operation (>3s) | Progress bar + estimated time | Spinner |
Skeleton screens feel 20–30% faster than spinners for the same wait time. They set layout expectations and eliminate "jumping" content.
Skeleton screen pattern (Tailwind)
function Skeleton({ className }: { className?: string }) {
return (
<div
className={cn("animate-pulse rounded-md bg-muted", className)}
aria-hidden="true"
/>
);
}
// Usage — mirror the actual layout
function CardSkeleton() {
return (
<div className="rounded-lg border p-4 space-y-3">
<div className="flex items-center gap-3">
<Skeleton className="h-10 w-10 rounded-full" />
<div className="space-y-1.5 flex-1">
<Skeleton className="h-4 w-3/4" />
<Skeleton className="h-3 w-1/2" />
</div>
</div>
<Skeleton className="h-20 w-full" />
<Skeleton className="h-4 w-2/3" />
</div>
);
}
Optimistic UI pattern
function useLikePost(postId: string) {
const [liked, setLiked] = useState(false);
async function toggleLike() {
// 1. Update UI immediately (optimistic)
setLiked((prev) => !prev);
try {
// 2. Sync with server
await api.toggleLike(postId);
} catch {
// 3. Revert on error
setLiked((prev) => !prev);
toast.error("Failed to update. Please try again.");
}
}
return { liked, toggleLike };
}
Use optimistic UI for: liking, bookmarking, toggling settings, marking items complete. Not suitable for: payments, deletions, irreversible actions.
CLS Prevention (Cumulat
Установить interaction-design в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGrepGlobWriteEditFAQ
Что делает скилл interaction-design?
Interaction design patterns for web interfaces. Covers motion and animation timing, microinteractions, loading states, skeleton screens, optimistic UI, form UX, mobile touch targets, thumb zones, and responsive interaction patterns. USE WHEN: user mentions "animation", "transition", "loading state", "skeleton screen", "microinteraction", "form UX", "touch target", "mobile UX", "thumb zone", "optimistic UI", "perceived performance", "CLS", "reduced motion", "bottom navigation", "hamburger menu", asks "how fast should animations be" DO NOT USE FOR: CSS animation syntax (use styling/tailwindcss), performance profiling (use best-practices/performance), WCAG audit (use accessibility/wcag)
Как установить скилл interaction-design?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл interaction-design запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic