Pulsating Button
- Source
- Magic UI ↗
- Author
- Magic UI
- Licence
- MIT
Loading…
A button that breathes a soft ring of its own colour.
Code
"use client";
import { PulsatingButton } from "@/lab/magicui/ui/pulsating-button";
export default function PulsatingButtonDemo() {
return (
<div className="relative flex h-full w-full items-center justify-center">
<PulsatingButton>Join Affiliate Program</PulsatingButton>
</div>
);
}
Prompt
Build "Pulsating Button", a button animation. What it does: A button that breathes a soft ring of its own colour. Write it as a single self-contained React component in TypeScript that fills its parent (w-full h-full), styled with Tailwind CSS. Technique: a requestAnimationFrame loop. It sits on a light background, in a 16:10 frame. Respect prefers-reduced-motion with a still state, pause work when the element is off screen, and keep it accessible. Original: https://magicui.design/docs/components/pulsating-button (Magic UI, MIT).