Pulsating Button

An animated pulsating button useful for capturing attention of users.

Installation

pnpm dlx shadcn-svelte@latest add https://sv-animations.vercel.app/r/pulsating-button.json

Usage

<script lang="ts">	import { PulsatingButton } from "#lib/components/magic/pulsating-button/index.js";</script>
<PulsatingButton>Get started</PulsatingButton>

Examples

Ripple Variant

Ring Variant

Duration Example

Duration: 1.5s

Duration: 3s

Duration: 6s

Colors Example

Color: Teal

Color: Yellow

Color: Red

Distance Example

Distance: 4px

Distance: 8px

Distance: 12px

Minimal Example

Minimal Cyan Example

Props

Pulsating Button

A component for Pulsating Button.

NameTypeDefaultDescription
classClassValue""Additional CSS classes to apply
pulseColorstring"#808080"Color of the pulse
durationstring"1.5s"Duration of the animation
childrenSnippetrequiredThe content to display inside the button
variant"slow" | "ring" | "ripple""slow"The animation variant to use
distancestring"8px"The distance the pulse expands to (applicable for 'ring' and 'ripple' variants)