Small interactions that make interfaces feel alive
A button, a little movement, and a clear answer to what just happened.
You press Save and nothing changes, so you press it again. Now you have saved twice, or once, or not at all. The button knows which. You don't.
Most of what people call the "feel" of an interface is the interface answering a press before you start to wonder. Press the button below, then switch the outcome to Fails and press it again.
Name the states before you animate them
The button has four labels, and each one is a state:
type Phase = "idle" | "saving" | "saved" | "failed";
I write that line before I touch an easing curve. Motion describes a change from one state to another, so if I can't name both ends I have nothing to animate yet.
The wait in the demo is a fake 700ms setTimeout, there so you can see the middle state. A real save should take as long as it takes and no longer.
The motion is deliberately small. The button presses down to scale(0.97), and the label swaps with a 160ms fade, a 2px blur and a 4px rise. The button has a fixed width, so the rest of the page doesn't shift when "Save note" turns into "Saved". By the tenth save of the day you stop seeing any of it, and that is the size I want for something people repeat all day.
Failure needs its own design
With Fails selected, the same control has a different job. It has to say the save didn't happen and put the retry exactly where your pointer already is. A nice success animation only covers one of the two endings.
The constellation copy plate in the Lab pushes the happy path further: stars join into a check inside the button, next to a "Copied" label. The label is the part that has to work. Miss the stars and the text still tells you what happened.
Let people change their mind
Grab a control and let go halfway. That tells you more about an interaction than watching it finish. In the crumple bin, releasing the file near where you picked it up smooths the ball back into a file instead of counting it as a throw, and Undo brings back a file you did delete. Those rules belong to the component as much as the throw does.
A real form is harder. Once a request has left the browser, an animation can't take it back, so cancel and undo have to be built into the system behind the button.
The parts you can't see
A "Saved" label means nothing to a screen reader unless something announces it. role="status" does that job: it is a polite live region, so assistive technology reads the change without moving focus. WCAG 2.2 covers this under status messages, and every state in the demo goes through one.
Motion needs an off switch too. Animation from interactions is a Level AAA criterion, the strictest of WCAG's three levels, and I build for it anyway because it costs almost nothing:
const reduce = useReducedMotion();
const swap = { duration: reduce ? 0 : 0.16, ease: [0.22, 1, 0.36, 1] };
Turn on reduced motion in your system settings and reload this page. The button goes through the same four states and skips the blur and the rise.