Ripple Effect
A circular wave that expands from the press point—visual proof the tap registered.
Also known as material ripple · ink splash · touch wave
Demo · not production-ready code
Prompt for AI
Pick a stack, copy a ready prompt, paste into Cursor / Claude / ChatGPT.
Your stack
Shapes the prompt you copy
React + Tailwind + shadcn/ui · EN
Stack: React + Tailwind + shadcn/ui. Use React with Tailwind CSS and shadcn/ui patterns (Radix-based primitives, cn(), class-first styling). Task: implement "Ripple Effect". Add a ripple on pointerdown: append a span at actual pointer coordinates (not center), scale from 0 until it covers the clipped button, fade out, then remove the node. Keep iOS-style screens on opacity/scale press instead if matching platform conventions. Anatomy: - origin: Must be the real pointer coordinates, not the element center. - ripple circle: Scales from 0 until it covers the control while fading out. - pressed state: Ripple is one form of press feedback; iOS prefers dim or scale. Preferred API / pattern: `MUI Button ripple / custom pointerdown ink` Keep scope minimal: only this UI pattern, match existing project style.
Acceptance checks
- ○Avoid: Ripple always from center
- ○Avoid: Nodes never removed
- ○Avoid: Ripple without overflow hidden
- ○Avoid: Using ripple as the only feedback with no pressed style for keyboard a
In plain wordsHow people search for it
AnatomyOpen for part names
- origin
- Must be the real pointer coordinates, not the element center.
- ripple circle
- Scales from 0 until it covers the control while fading out.
- pressed state
- Ripple is one form of press feedback; iOS prefers dim or scale.
How to write itOpen for stack patterns
JS span at pointer coords + scale keyframesMUI Button ripple / custom pointerdown inkno Material ripple—use opacity/scale press stateswave effect on Button (Material-inspired)Notes
Material’s signature “I heard your tap.” It has an accent: native on Android, almost never on iOS (dim/scale instead). Forcing ripples everywhere makes an iOS app feel Android-ish. Implementation: overflow hidden, origin from event coords, remove the node when the animation ends. Rapid taps each get their own wave—don’t cancel siblings mid-flight.
Common mistakesHumans and models trip here
- Ripple always from center: tap the corner, wave starts mid-button—fake.
- Nodes never removed: a hundred leftover spans after a hundred taps.
- Ripple without overflow hidden: the wave paints outside the button.
- Using ripple as the only feedback with no pressed style for keyboard activation.
More failure symptoms on AI broke it.
Related patterns
Spotted a wrong name or missing pattern?