Ripple Button

A button that sends a ripple out from where it is clicked.

<script setup lang="ts">
import { RippleButton, RippleButtonRipples } from '@animate-ui/vue/primitives/buttons/ripple'

withDefaults(defineProps<{ tapScale?: number | string }>(), { tapScale: 0.97 })
</script>

<template>
  <RippleButton
    :tap-scale="Number(tapScale)"
    class="bg-primary text-primary-foreground h-10 rounded-lg px-4 text-sm font-medium [--ripple-button-ripple-color:var(--primary-foreground)]"
  >
    Ripple Button
    <RippleButtonRipples />
  </RippleButton>
</template>

Installation

npm install @animate-ui/vue motion-v
pnpm add @animate-ui/vue motion-v
yarn add @animate-ui/vue motion-v
bun add @animate-ui/vue motion-v

Usage

<script setup lang="ts">
import { RippleButton, RippleButtonRipples } from '@animate-ui/vue/primitives/buttons/ripple';
</script>

<template>
  <RippleButton class="[--ripple-button-ripple-color:white]">
    Send
    <RippleButtonRipples />
  </RippleButton>
</template>

Animation

  • Each click sends a ripple from the pointer: it grows to scale while fading out over 0.6s, then is removed. Rapid clicks each get their own ripple.
  • Pressing scales the button to tap-scale (0.97), on Motion's spring for scale (stiffness: 550, damping: 30). It doesn't scale on hover, unless you set hover-scale.
  • <AnimateUIProvider :tempo> paces the default spring and ripple.
  • Under reduced motion, the ripple fades in place without growing, and the button doesn't scale.

API Reference

RippleButton

PropTypeDefault
hover-scale?
number1
tap-scale?
number0.97
transition?
Transition{ type: 'spring', stiffness: 550, damping: 30, restSpeed: 10 }
as-child?
booleanfalse
...props?
HTMLMotionProps<'button'>-

RippleButtonRipples

PropTypeDefault
color?
string'var(--ripple-button-ripple-color)'
scale?
number10
transition?
Transition{ duration: 0.6, ease: 'easeOut' }
as-child?
booleanfalse
...props?
HTMLMotionProps<'span'>-

CSS variables

PropTypeDefault
--ripple-button-ripple-color?
color-

Built by Skyleen. The source code is available on GitHub.

Last updated: 10/23/2026