Skip to main content
A captivating button component featuring a shimmering light that travels around the perimeter.

Installation

npx shadcn@latest add @magicui/shimmer-button

Required CSS

Add these animations to your global CSS:
@theme inline {
  --animate-shimmer-slide: shimmer-slide var(--speed) ease-in-out infinite alternate;
  --animate-spin-around: spin-around calc(var(--speed) * 2) infinite linear;

  @keyframes shimmer-slide {
    to {
      transform: translate(calc(100cqw - 100%), 0);
    }
  }
  @keyframes spin-around {
    0% {
      transform: translateZ(0) rotate(0);
    }
    15%, 35% {
      transform: translateZ(0) rotate(90deg);
    }
    65%, 85% {
      transform: translateZ(0) rotate(270deg);
    }
    100% {
      transform: translateZ(0) rotate(360deg);
    }
  }
}

Usage

import { ShimmerButton } from "@/components/ui/shimmer-button"

export default function Example() {
  return <ShimmerButton>Click me</ShimmerButton>
}

Props

shimmerColor
string
default:"'#ffffff'"
Color of the shimmering light effect
shimmerSize
string
default:"'0.05em'"
Size of the shimmer effect
borderRadius
string
default:"'100px'"
Border radius of the button
shimmerDuration
string
default:"'3s'"
Duration of the shimmer animation
background
string
default:"'rgba(0, 0, 0, 1)'"
Background color of the button
className
string
Additional CSS classes to apply
children
React.ReactNode
Button content

Features

  • Animated shimmer border effect
  • Customizable colors and timing
  • Smooth hover interactions
  • Active state with press feedback
  • Fully customizable with Tailwind CSS

Credits

Inspired by @jh3yy

Build docs developers (and LLMs) love