Pulse Button
wise-ui/pulse-buttonFreeComponent
A button with a pulsing glow animation.
Live preview
live · rendered by the registry
Rendered by wise-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://wise-ui.com/r/pulse-button.jsonSource
1"use client"23import * as React from "react"4import { motion } from "motion/react"5import { cn } from "@/registry/wise-ui/lib/utils"67interface PulseButtonProps8 extends React.ButtonHTMLAttributes<HTMLButtonElement> {9 /** Pulse ring color */10 pulseColor?: string11 /** Seconds per pulse cycle */12 duration?: number13 children: React.ReactNode14}1516const PulseButton = React.forwardRef<HTMLButtonElement, PulseButtonProps>(17 (18 {19 pulseColor = "hsl(var(--primary))",20 duration = 2,21 children,22 disabled,23 className,24 ...props25 },26 ref27 ) => {28 return (29 <div className="relative inline-flex rounded-md">30 {/* Pulse rings */}31 {!disabled && (32 <>33 <motion.div34 className="pointer-events-none absolute inset-0 rounded-md"35 style={{36 border: `2px solid ${pulseColor}`,37 }}38 animate={{ scale: [1, 1.6], opacity: [0.4, 0] }}39 transition={{40 duration,41 repeat: Infinity,42 ease: "easeOut",43 }}44 />45 <motion.div46 className="pointer-events-none absolute inset-0 rounded-md"47 style={{48 border: `2px solid ${pulseColor}`,49 }}50 animate={{ scale: [1, 1.6], opacity: [0.4, 0] }}51 transition={{52 duration,53 delay: duration / 2,54 repeat: Infinity,55 ease: "easeOut",56 }}57 />58 </>59 )}6061 <button62 ref={ref}63 disabled={disabled}64 className={cn(65 "relative inline-flex cursor-pointer items-center gap-2 rounded-md bg-primary px-5 py-2.5 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90",66 "disabled:cursor-not-allowed disabled:opacity-50",67 className68 )}69 {...props}70 >71 {children}72 </button>73 </div>74 )75 }76)77PulseButton.displayName = "PulseButton"7879export { PulseButton }80export type { PulseButtonProps }
What it pulls in
npm packages
Files it writes
More from wise-ui
All 20 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Animated Tabsanimated-tabs | wise-ui | Components | Free | 3 deps | |
| Border Beamborder-beam | wise-ui | Components | Free | 3 deps | |
| Data Tabledata-table | wise-ui | Components | Free | 3 deps | |
| Dockdock | wise-ui | Components | Free | 3 deps | |
| Dot Matrixdot-matrix | wise-ui | Components | Free | 2 deps | |
| Editable Texteditable-text | wise-ui | Components | Free | 4 deps | |
| Gradient Sidebargradient-sidebar | wise-ui | Components | Free | 3 deps | |
| Kanban Boardkanban-board | wise-ui | Components | Free | 6 deps |
