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


Docs
Pulsating Button

Pulsating Button

An animated pulsating button useful for capturing attention of users.

Installation

Run the following command:

npx magicui-cli add pulsating-button

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: {
        pulse: "pulse var(--duration) ease-out infinite",
      },
      keyframes: {
        pulse: {
          "0%, 100%": { boxShadow: "0 0 0 0 var(--pulse-color)" },
          "50%": { boxShadow: "0 0 0 8px var(--pulse-color)" },
        },
      },
    },
  },
};

Props

PropTypeDescription
childrenReact.ReactNodeThe content of the button.
classNamestringAdditional class names for the button.
pulseColorstringThe rbg numbers only for the color of the pulsing waves.
durationstringThe time span of one pulse.

Credits