Ripple
Material-style press ripple, used by buttons, toggles and tabs.
Installation
bun add @xerobi/ui
import { Ripple } from "@xerobi/ui/ripple"This component is client-side. In Astro, hydrate it with a client directive.
API reference
Ripple
Material-style press ripple. Render it as a child of any pressable element that is `position: relative`; it listens on that parent and paints a circle that expands from the press point and fades when the press ends. It draws with `currentColor`, so it follows the text colour of the surface. Honours `prefers-reduced-motion` and does nothing on disabled parents.
| Prop | Type | Description |
|---|---|---|
| center | boolean | Start every ripple at the centre instead of the press point, e.g. for icon buttons. |
| disabled | boolean | Turns the effect off while keeping the element mounted. |
Styling hooks: [data-slot="ripple"].