A soft ink wave from the press point. Wrap a button or any surface and tune duration, opacity, and color.
Button
650ms
0.28
Color
tsx
import { Ripple } from "@/components/motion/ripple"import { Button } from "@/components/ui/button"export function Example() { return ( <Ripple className="inline-flex rounded-md" duration={650} opacity={0.28} color="currentColor" centered={false} > <Button>Press me</Button> </Ripple> )}Surface
Press anywhere
650ms
0.28
Color
tsx
import { Ripple } from "@/components/motion/ripple"export function Example() { return ( <Ripple className="flex h-40 w-full max-w-sm items-center justify-center rounded-xl border border-border bg-muted/50" duration={650} opacity={0.28} color="#71717a" centered={false} > <span className="text-sm text-muted-foreground">Press anywhere</span> </Ripple> )}Installation
npx @arctis-sh/@arctis-sh/ui@latest add rippleUsage
import { Ripple } from "@/components/motion/ripple"import { Button } from "@/components/ui/button"<Ripple className="inline-flex rounded-md"> <Button>Press me</Button></Ripple>API Reference
Ripple
| Prop | Type | Default |
|---|---|---|
| duration | number | 650 |
| color | string | currentColor |
| opacity | number | 0.28 |
| centered | boolean | false |
| className | string | — |
| children | ReactNode | — |
Also accepts the other native div attributes. Duration is in milliseconds.