Ripple Surface

PaymentPress confirm
MC

Maya Chen

Personal account

Review

You're sending

$1,250.00USD

From
Everyday •• 4821
Reference
Studio rent
Fee
Free
Arrives
In seconds

Setup

$npx shadcn@latest add https://kinetikui.singhgourav.site/r/ripple-surface.json

Usage

Wrap any card. By default a ripple starts wherever the card is pressed. Give the wrapper the same corner radius as the card so the glint follows its edge.

ReportTap anywhere
✦

Investor update

Draft · edited 2 min ago

Q3 at a glance

Volume grew 38% this quarter, driven by faster settlement and two new payout partners.

+38%

Volume

1.2s

Settle

$0.002

Avg fee

Example
import { RippleSurface } from "@/components/ui/ripple-surface"

export function Card() {
  return (
    <RippleSurface accent="#40d9bf" className="rounded-3xl">
      <div className="rounded-3xl border bg-white p-6 dark:bg-neutral-900">Tap anywhere</div>
    </RippleSurface>
  )
}

It works on light and dark cards. With tone="auto" it reads the card's background when the effect starts: on dark cards the echo glows and the glint is bright silver, on light cards the echo tints the text edges and the glint turns to dark chrome.

To tie the effect to an action, set trigger="none" and drive it through a ref: ripple from the button press, then run the glint once the action succeeds.

Example
const surface = useRef<RippleSurfaceHandle>(null)

<RippleSurface ref={surface} trigger="none" className="rounded-3xl">
  <button
    onPointerDown={async (e) => {
      surface.current?.rippleFromEvent(e)
      await pay()
      surface.current?.glint()
    }}
  >
    Confirm payment
  </button>
</RippleSurface>

The ripple is an SVG displacement filter applied to the real DOM, so text stays selectable. The filter is only attached while the ripple plays. On touch devices and low-end hardware it uses a single displacement pass at 30 fps without the accent echo. The glint is a rotating gradient masked to the border, animated with transforms only.

Props

PropTypeDefaultNotes
trigger"press" | "none""press"Ripple on every press, or only when called through the ref.
accentstring"#8c6bff"Hex colour of the echo that trails the ripple.
tone"auto" | "light" | "dark""auto"Light or dark styling for the echo and glint. Auto reads the card's background.
intensitynumber26How far the ripple pushes pixels, in px.
durationnumber950Length of the ripple in ms.
classNamestringOn the wrapper. Set the corner radius here.
surfaceClassNamestringOn the inner layer that the filter distorts.

Ref

MethodNotes
ripple(x?, y?)Start a ripple at a point inside the card. Defaults to the centre.
rippleFromEvent(event)Start a ripple where a pointer event happened.
glint()Run the metallic glint around the border once.

Accessibility

  • The ripple and glint are decorative; the glint is aria-hidden and ignores the pointer
  • With prefers-reduced-motion, neither the ripple nor the glint runs
  • Content inside stays real DOM: readable, focusable and selectable