04.04 · Micro-Interactions

Button Press Scale

Shrinks as you press it and springs back as you let go. Best for main buttons.

Click it

Press and hold a button, then let go, or press Show me.

Try it

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

Press depth

How much the button shrinks while held down.

Release speed

How long it takes to spring back.

Release feel

Springy goes a little past full size, then settles.

More optionsFewer options

Press speed

A press should feel instant, so keep it short.

Copy the prompt

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

Add press feedback to [the buttons you want to feel tactile]. While a button is held down it shrinks, as if pushed in, and when it is let go it returns to full size. A press that is quicker than the release feels most like a real button. Respond to mouse, touch and pen presses and to Space and Enter on the keyboard, and let go cleanly if a press turns into a scroll, so no button stays stuck down. Change only the button's size so nothing around it moves. If the visitor has reduced motion turned on, change the size at once, 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

  • Main buttons
  • Icon buttons
  • Mobile apps

Avoid on

  • Links in text
  • Large cards