Skip to content

Ripple

Touch feedback that grows from the point of interaction.

Installation

Terminal
pnpm dlx shadcn@latest add https://react-toolbox.io/r/ripple.json

New here? Set up your project first. Styles, fonts, and required components are included.

Usage

Render the ink returned by useRipple inside the host and attach its event handlers. The host needs relative positioning and overflow-hidden. Buttons already include ripple feedback.

API reference

Key props and defaults. Full types and inline documentation are included with the source in material/ripple.

useRipple

Property Type Default
centered boolean false
disabled boolean false
multiple boolean true
spread number 2

Material guidelines

  • Use ink feedback to connect a press to the surface receiving it. Keep the effect contained by that surface’s shape.
  • Ripple is visual feedback, not an interaction by itself. Attach it to an accessible button or link and retain visible keyboard focus.

Material Design 1: Material motion