ui-ux-design-best-practices
Skill19 starsChanged 19 days agoApache-2.0View on GitHub
UI/UX polish, component design, animation decisions, and Tailwind v4 patterns for making interfaces feel right. Use when reviewing, writing, or refactoring UI code involving animations, transitions, CSS transforms, gestures, Tailwind utility classes, or interactive component behavior. Triggers on tasks involving motion design, interactive states (hover/active/focus), component feel, or any use of Tailwind transition/transform/animation utilities.
In this repository59 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/skills/vercel-react-best-practices/AGENTS.mdAGENTS.md
- hooks/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- hooks/CLAUDE.mdCLAUDE.md
- .cursor/rules/backend/hono-gateway.mdcCursor rule
- .cursor/rules/backend/ports.mdcCursor rule
- .cursor/rules/backend/service-bindings.mdcCursor rule
- .cursor/rules/backend/workers-cache.mdcCursor rule
- .cursor/rules/backend/workers-config.mdcCursor rule
- .cursor/rules/contracts/contracts.mdcCursor rule
- .cursor/rules/core/agent-instructions.mdcCursor rule
- .cursor/rules/core/boundaries.mdcCursor rule
- .cursor/rules/core/guardrails.mdcCursor rule
- .cursor/rules/core/turborepo.mdcCursor rule
- .cursor/rules/core/worktrees.mdcCursor rule
- .cursor/rules/frontend/react.mdcCursor rule
- .cursor/rules/frontend/tailwind.mdcCursor rule
- .cursor/rules/frontend/tanstack-query.mdcCursor rule
- .cursor/rules/frontend/tanstack-router.mdcCursor rule
- .cursor/rules/frontend/vite-config.mdcCursor rule
- .cursor/rules/ops/cd.mdcCursor rule
- .cursor/rules/ops/changesets.mdcCursor rule
- .cursor/rules/ops/ci.mdcCursor rule
- .cursor/rules/ops/previews.mdcCursor rule
- .cursor/rules/ops/quality-report.mdcCursor rule
- .cursor/rules/ops/release.mdcCursor rule
- .cursor/rules/quality/code-style.mdcCursor rule
- .cursor/rules/quality/comments.mdcCursor rule
- .cursor/rules/quality/knip.mdcCursor rule
- .cursor/rules/quality/lint-config.mdcCursor rule
- .cursor/rules/quality/markdown-style.mdcCursor rule
- .cursor/rules/quality/naming.mdcCursor rule
- .cursor/rules/quality/reporting.mdcCursor rule
- .cursor/rules/quality/simplicity.mdcCursor rule
- .cursor/rules/quality/testing.mdcCursor rule
- .cursor/rules/quality/typescript-config.mdcCursor rule
- .cursor/rules/tests/front-react.mdcCursor rule
- .cursor/rules/tests/hono-workers.mdcCursor rule
- cfSkill
- changesetSkill
- front-vitestSkill
- git-commitSkill
- honoSkill
- monorepo-agent-setupSkill
- pnpmSkill
- react-doctorSkill
- reviewSkill
- review-stackSkill
- run-appSkill
- security-auditSkill
- skills-updateSkill
- tanstack-configSkill
- tanstack-querySkill
- tanstack-routerSkill
- turborepoSkill
- vercel-react-best-practicesSkill
- workers-best-practicesSkill
- skills-updateSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are 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.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 120
When reviewing UI code, output a markdown table:
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 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
UI/UX Design Best Practices
Guidelines for building interfaces where every interaction detail compounds into something that feels right. Covers animation decisions, Tailwind v4 motion utilities, component interaction patterns, and accessibility requirements.
When to Apply
Load this skill when:
- Writing or reviewing components with hover, active, focus, or enter/exit animations
- Implementing transitions, transforms, or keyframe animations (CSS or Tailwind)
- Reviewing Tailwind utility usage for motion-related classes
- Designing interactive elements: buttons, dropdowns, modals, drawers, tooltips, popovers
- Checking accessibility for motion sensitivity (
prefers-reduced-motion) - Implementing gesture or drag interactions
- Debugging janky or sluggish animations
Reference Documentation
Animation
rules/animation-decision-framework.md- core philosophy, should-animate decision tree, easing selection, duration cheatsheet, perceived performancerules/animation-springs.md- spring config (Framer Motion / Motion), mouse interactions, interruptibility advantagerules/animation-component-patterns.md- buttons, scale(0) rule, origin-aware popovers, tooltip instant-on-subsequent, blur crossfadesrules/animation-transitions-transforms.md- CSS transitions vs keyframes,@starting-style, translateY percentages, scale children, GPU accelerationrules/animation-clip-path.md-inset()shape, hold-to-delete/confirm pattern, tab color transitions, scroll reveals, comparison slidersrules/animation-gestures.md- momentum dismissal, boundary damping, pointer capture, multi-touch protection, friction stopsrules/animation-performance.md- only animate transform/opacity, CSS variable inheritance, Framer Motion hardware acceleration, WAAPIrules/animation-accessibility-stagger.md-prefers-reduced-motion, touch hover gating, stagger delays, asymmetric enter/exit timingrules/animation-review-checklist.md- component design principles, slow-motion debugging, review checklist table
Tailwind v4
rules/tailwind-v4-changes.md- v3→v4 migration table, arbitrary value syntax, CSS variable shorthandrules/tailwind-transitions.md-transition-property,transition-duration,transition-timing-function,transition-delayrules/tailwind-transforms.md-scale,translate,rotate,transform-origin, GPUtransform-gpurules/tailwind-animations.md-animate-*builtins, custom@themekeyframesrules/tailwind-effects.md-opacity,blur,backdrop-blurrules/tailwind-interactivity.md-will-change,pointer-events,cursor,user-selectrules/tailwind-variants.md-motion-reduce:/motion-safe:, touch hover gating,starting:, stacking variantsrules/tailwind-patterns.md- ready-to-use patterns (button, dropdown, modal, toast, tooltip, stagger, frosted glass) + anti-patterns table
Quick Reference
The One Rule
Only animate transform and opacity. These skip layout and paint, running on the GPU. Animating height, padding, margin, or width triggers all three rendering steps and causes jank.
Animation Decision by Frequency
| Frequency | Decision |
| 100+ times/day (keyboard shortcuts, command palette) | No animation - ever |
| Tens of times/day (hover effects, list navigation) | Remove or drastically reduce |
| Occasional (modals, drawers, toasts) | Standard animation |
| Rare or first-time (onboarding, celebrations) | Can add delight |
Duration Cheatsheet
| Element | Duration |
| Button press feedback | 100–160ms |
| Tooltips, small popovers | 125–200ms |
| Dropdowns, selects | 150–250ms |
| Modals, drawers | 200–500ms |
| Marketing / explanatory | Can be longer |
Rule: UI animations under 300ms. A 180ms dropdown feels more responsive than a 400ms one.
Easing Cheatsheet
| Situation | Easing | Tailwind |
| Element entering / exiting | ease-out | ease-out |
| Element moving on screen | ease-in-out | ease-in-out |
| Hover / color change | ease | ease-linear or default |
| Constant motion (spinner, marquee) | linear | ease-linear |
Never use ease-in for UI interactions. It starts slow - the exact moment the user is watching most closely - making the interface feel sluggish.
Custom Easing Values (register in @theme)
@theme {
--ease-out-strong: cubic-bezier(0.23, 1, 0.32, 1);
--ease-in-out-strong: cubic-bezier(0.77, 0, 0.175, 1);
--ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}<!-- Use in Tailwind via CSS variable shorthand -->
<div class="ease-(--ease-out-strong)">...</div>Tailwind Quick Patterns
<!-- Button press feedback -->
<button class="transition-transform duration-160 ease-out active:scale-[0.97]">
<!-- Dropdown / popover entry (scale from origin) -->
<div class="transition-[transform,opacity] duration-200 ease-out
data-[state=closed]:scale-95 data-[state=closed]:opacity-0
origin-top-left">
<!-- Toast / modal entry -->
<div class="transition-[transform,opacity] duration-300 ease-out
starting:opacity-0 starting:translate-y-4">
<!-- Respect reduced motion -->
<div class="transition-transform motion-reduce:transition-none">Review Format
When reviewing UI code, output a markdown table:
| Before | After | Why |
transition: all 300ms | transition: transform 200ms ease-out | Specify exact properties; avoid all |
transform: scale(0) | transform: scale(0.95); opacity: 0 | Nothing appears from nothing |
ease-in on dropdown | ease-out with custom curve | ease-in feels sluggish |
No :active state on button | active:scale-[0.97] | Buttons must feel responsive to press |
transform-origin: center on popover | origin-[var(--radix-popover-content-transform-origin)] | Scale from trigger, not center |
| Animation on keyboard action | Remove animation entirely | Repeated 100x/day - animation adds delay |
| Duration > 300ms on UI element | Reduce to 150–250ms | Slow transitions feel broken |
Raw-CSS :hover without a @media (hover: hover) guard | Add @media (hover: hover) and (pointer: fine); Tailwind v4 hover: already includes (hover: hover) | Touch devices trigger hover on tap |
| Keyframes on rapidly-triggered element | CSS transitions for interruptibility | Keyframes restart from zero on interruption |
Framer Motion x/y props under load | transform: "translateX()" string | Short-hand props are not hardware-accelerated |
| Same enter/exit speed | Exit faster than enter | Slow deliberate entry, snappy exit |
| All elements appear at once | Stagger 30–80ms between items | Cascading feels more natural |
Full Reference
For detailed explanations, code examples, and Tailwind mappings, read the files listed in Reference Documentation above. Load only the specific rule files relevant to the current task to minimize token usage.
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.

