04.38 · Micro-Interactions
Button Loading States
The button becomes a spinner, then a tick or a cross. Best for Save buttons.
Click it
Click or tap Submit and wait for the answer, or press Show me.
Send feedback
The new dashboard is much faster. Thank you!
Inside, the dashed outline is the button's full size, which never changes: only its color shrinks to the circle while it sends, then shows a tick or a cross. Press Submit, or Show me.
No sign: after the press the button looks the same, so people tap again; Shows progress: it turns into a spinner, then a tick or a cross. Press Submit, or Show me.
Try it
Change a setting, then try it again or press Show me.
Result
Error shows a cross on red and a small shake.
Speed
How quickly the shape, the color and the icon change.
Off keeps the button's shape and changes only what is inside.
Copy the prompt
Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.
Add loading states to [the button that sends a form or saves something]. When it is pressed, fade its label out, show a spinner in its place and ignore further presses until it is done. When the answer comes, swap the spinner for a tick, or for a cross with a short shake if it failed, then bring the label back after a moment. When the settings ask for it, shrink the button's colored shape into a circle around the spinner with a clip, never by animating its width, so nothing around it moves. Announce each change to screen readers. If the visitor has reduced motion turned on, keep the shape and change the label's words instead. Match the settings listed below.
Your settings
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 GitHubWhat it is
The full explanation is in README.md.