Skip to content

Animation & Motion

Press Feedback

Free

Give buttons and rows a pressed state that does not shift layout.

Difficulty foundational
Version v1.1

Purpose

Provide tactile feedback without jank or fake 3D.

Procedure

--- name: press-feedback description: Give buttons and rows a pressed state that does not shift layout. ---

Press Feedback

Purpose

Provide tactile feedback without jank or fake 3D.

Procedure

Feedback is a color, opacity, or 1px translate that does not change the box size. Do not add a shadow on hover that increases the element's painted size enough to cause a neighbor to move. Prefer a border that is always there and changes color.

States to define, in order: default, hover, focus-visible, active, disabled. Disabled is not only faded; it does not respond to hover. aria-disabled and the disabled attribute should look the same.

Do not rely on hover for anything required. Touch devices may never hover. The action must be obvious at rest.

Active state (pressed) can darken the control slightly. Do not scale the button below 0.98; it makes labels blur.

Links in prose get an underline, not a hover-only underline. Controls that are already solid buttons do not also need underlines.

Cursor is pointer on enabled buttons. Do not set pointer on disabled controls.

Example requests

1. Button press

Request: Add Press Feedback to the primary button component only. Expected: A color or opacity change on press, no layout shift, visible focus.

Dependencies

None. Work in the repository that is already open. Do not add packages unless the procedure names one.

Compatibility

This document follows the Agent Skills layout (a folder named press-feedback containing SKILL.md). Claude Code, Cursor, Codex, and Gemini CLI can load that file from the paths in the Skilling installation guide. GitHub Copilot does not load SKILL.md. Use the Copilot instructions copy, and narrow applyTo before you commit it.

Example prompts

Button press

Add Press Feedback to the primary button component only.

Expected: A color or opacity change on press, no layout shift, visible focus.

Choose the agent

This skill is installed for one agent at a time. Pick the section you are using.

Related

  • Motion Rules

    Add motion only to explain a change: 150–250ms, ease-out, and a reduced-motion path.

  • CSS Hover

    Implement hover, focus, and rest states in CSS before reaching for a motion library.

  • Component API

    Shape a React component's props around composition and a small variant set, not boolean soup.

Reviews

No reviews yet.

    Sign in to review.

    Report a problem

    Inaccurate steps, an unsafe instruction, or a licensing concern.

    Sign in to report.