Ripple

Wrap any surface. A press sends a soft circle out from the exact point of contact. Effects.

Open playground
Press anywhere

About

Ripple is a React component in the Effects category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { Ripple } from "@ashutoshswamy/smoui" and set children, color.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { Ripple } from "@ashutoshswamy/smoui";

<Ripple className="rounded-2xl bg-neutral-100 p-8">Press anywhere</Ripple>

Props 2

children

The surface. Needs a rounded class on Ripple itself to clip to.

ReactNode
color

Ripple colour, drawn at low strength.

stringdefault "currentColor"