1
3
Block

Shimmer Button

PreviousNext

A button with a shimmering light which travels around the perimeter.

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

export function ShimmerButtonDemo() {
  return (
    <ShimmerButton className="shadow-2xl">
      <span className="text-center text-sm leading-none font-medium tracking-tight whitespace-pre-wrap text-white lg:text-lg dark:from-white dark:to-slate-900/10">
        Shimmer Button
      </span>
    </ShimmerButton>
  )
}

Installation

pnpm dlx shadcn@latest add https://ebonui.com/r/shimmer-button.json

Usage

import { ShimmerButton } from "@/components/ui/shimmer-button"
<ShimmerButton>Shimmer Button</ShimmerButton>

Props

PropTypeDefaultDescription
shimmerColorstring#ffffffThe color of the shimmer
shimmerSizestring0.05emThe size of the shimmer
borderRadiusstring100pxThe border radius of the button
shimmerDurationstring3sThe duration of the spark animation
backgroundstringrgba(0, 0, 0, 1)The background of the button
classNamestringundefinedThe class name of the button
childrenReact.ReactNodeundefinedThe children of the button

Credits

Credit to @jh3yy for the inspiration behind this component.