04.01 · Micro-Interactions

Hover State Animation

Six ways a card can react when you point at it. Best for buttons and cards.

Hover it

Point at a card (press and hold it on a phone, or Tab to it), or press Show me.

Color change
Grow
Lift
Underline
Arrow nudge
Sweep

Try it

Change a setting, then try it again or press Show me.

Speed

Quick feels responsive; slow can feel sticky.

Feel

Springy goes a little too far, then settles.

Copy the prompt

Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.

Add hover feedback to [the buttons, links or cards you want to react]. When the pointer moves over an item, change it in one clear way: shift its background color, grow it slightly, lift it with a deeper shadow, draw an underline out from the left, nudge its arrow forward, or sweep a tint across it. Use one style per kind of item and keep it the same across the page. Apply hover styles only on devices that can hover, and show the same change while an item is pressed on touch screens. If the visitor has reduced motion turned on, switch the look without animating it. Match the settings listed below.

Replace the words in brackets with your own element. Your settings are added at the end.

Free and open source. If this helped, a star on GitHub helps other people find it.

Star on GitHub

What it is

The full explanation is in README.md.

Good for

  • Buttons
  • Links
  • Cards
  • Menus

Avoid on

  • Plain text
  • Non-clickable items