All effects
Parameter playground

Drag a slider: the demo replays itself so the difference is visible, and the matching number inside the prompt is rewritten. Copy it and you take a prompt tuned to your taste.

Press depth 0.96× The button auto-presses: 0.98 is a feather touch, 0.9 visibly sinks
Release time 0.45s Auto-press and release: 0.2s pops back crisp, 0.8s swells back slowly
Buttons

Springy Press Feedback

Buttons compress to 0.96 with a deep inner shadow on press, then overshoot back on release.

AI Prompt
Add springy tactile feedback to buttons: on press the button physically compresses to 0.96 scale with a deeper inset shadow, and on release it returns with a slight overshoot (Spring Overshoot - past 1.02 then settling at 1, springs back over 0.45s), simulating a real pressed feel. Use CSS transform plus native JS pointer events.

How it works

The effect is two states and one carefully chosen transition curve. On pointerdown, a class flips the button to scale(0.96) and deepens the inset shadow, mimicking a key being pressed into its housing. On release the class drops and the button transitions back with an overshooting curve - a cubic-bezier whose second value exceeds 1 (the spring preset 0.34, 1.56, 0.64, 1 works well) - so it flies past its resting scale before settling. That overshoot is the entire illusion of springiness; a plain ease-out return reads as damped and lifeless.

The implementation detail most versions get wrong is state ownership. CSS :active seems tempting, but if the finger slides off the button before lifting, browsers can leave the pressed style stuck. This demo uses pointer events with setPointerCapture, so the element keeps receiving updates even when the pointer drifts outside, and pointerup or pointercancel always restores the rest state. Only transform and box-shadow are transitioned, so the interaction stays on the compositor and costs nothing during scroll.

How to use this prompt

Paste the prompt and mention your stack - for React, ask for a small hook or a Pressable-style wrapper instead of inline handlers on every button. If your UI already has design tokens for radii and shadows, tell the AI to read those variables so the pressed shadow deepens proportionally rather than by a hardcoded amount.

Tips for better results

Match compression to size: large cards feel natural at 0.97 to 0.98, small icon buttons can go to 0.94 without looking squashed. Keep the release transition slightly longer than the press (about 0.35s versus 0.1s) so the spring reads clearly. And make sure repeated taps interrupt the animation smoothly - class toggling on pointer events handles this for free, while CSS :active does not.

Keep exploring