agentleFS
bo-516bo-516/NiceDesign/skills/web/web-interaction/SKILL.md

web-interaction

Skill1 starsChanged 22 days agoMITView on GitHub

Use when designing hover/focus/active/disabled/loading/error states, forms, buttons, micro-interactions, or CSS transition budgets. Distilled from impeccable interaction, better-ui, micro-interactions, Vercel guidelines, taste-skill.

The file

Files
SKILL.md

Web Interaction

Rules for controls, states, and micro-feedback. Motion budgets that are not GSAP timelines belong here; scroll/timeline choreography → web-animation.

Eight states (every interactive control)

StateTreatment
DefaultRest styles
HoverContrast↑; optional lift (translateY(-1px)) + shadow↑
FocusVisible ring (:focus-visible); never outline: none without replacement
Active/pressedscale(0.96–0.98) or translateY(1px)
DisabledOpacity↓ + pointer-events: none / aria-disabled; not color alone
LoadingSkeleton matching final shape > generic spinner
ErrorInline message + aria-describedby; border/icon
Empty/successDirectional empty; success confirmation

Hover ≠ focus. Design both.

Forms

  • Visible <label>; placeholders are not labels.
  • Validate on blur (except password strength).
  • Error below field; helper optional above/below consistently.
  • CTA text one line at desktop; one label per intent page-wide.
  • Button text vs fill ≥ 4.5:1 (large text 3:1).

Feedback contracts

  • Interaction feedback ≤ 100ms perceived.
  • Hover: transform + color + shadow together when elevating; never change font-weight / padding / border-width on hover (layout jump).
  • Disable pointer events on exiting elements.
  • Optimistic UI only for low-stakes actions.
  • Destructive: prefer undo over confirm when possible.

Micro-motion (CSS / small UI)

--motion-fast: 120ms;   /* color, opacity, tooltip */
--motion-base: 200ms;   /* dropdown, toggle, tab */
--motion-medium: 280ms; /* modal, drawer */
--motion-slow: 400ms;   /* page/sheet — rare */
--ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  • Exit ≈ 75% of enter duration.
  • List properties: never transition: all.
  • Animate transform / opacity only for continuous motion.
  • Stagger siblings 30–80ms (marketing may 100–150ms).
  • High-frequency (shortcuts, typing): no animation.
  • Dashboard/settings: micro only; no entrance carnival.
  • Bounce/elastic banned on functional UI.
  • Honor prefers-reduced-motion (keep loaders + focus perceptible).

Pointer / touch

  • Touch targets ≥ 44px.
  • :hover gated with @media (hover: hover).
  • touch-action / tap-highlight as needed.

Ban

  • Hover-only affordances with no focus style
  • Spinner for known layouts (use skeleton)
  • Duplicate CTAs with same intent
  • transition: all
  • Motion that blocks input while stagger plays

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

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.