Introducing Magic UI Pro - 50+ blocks and templates to build beautiful landing pages in minutes.


Docs
Ripple

Ripple

An animated ripple effect typically used behind elements to emphasize them.

Ripple

Installation

Run the following command:

npx magicui-cli add ripple

Update tailwind.config.js

Add the following animations to your tailwind.config.js file:

tailwind.config.js
/** @type {import('tailwindcss').Config} */
module.exports = {
  theme: {
    extend: {
      animation: {
        ripple: "ripple var(--duration,2s) ease calc(var(--i, 0)*.2s) infinite",
      },
      keyframes: {
        ripple: {
          "0%, 100%": {
            transform: "translate(-50%, -50%) scale(1)",
          },
          "50%": {
            transform: "translate(-50%, -50%) scale(0.9)",
          },
        },
      },
    },
  },
};

Props

PropTypeDefaultDescription
mainCircleSizenumber210The size of the main circle in pixels
mainCircleOpacitynumber0.24The opacity of the main circle
numCirclesnumber8The number of ripple circles to render