Skip to Content
zjkm-ui
Components

Shimmer Button

A button with light sweeping across it.

Props
2.4s
<ShimmerButton>
  Get started
</ShimmerButton>

Installation

npx shadcn@latest add https://ui.zjkm.tech/r/shimmer-button.json
import { ShimmerButton } from "@/components/shimmer-button"

Using JavaScript? Set tsx: false in components.json and the CLI converts it.

New to shadcn? Run npx shadcn@latest init first. The CLI needs components.json and the @/ import alias.

Usage

A dark button with a band of light sweeping across it every few seconds. It's a real <button>, so it takes every native prop.

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

export function Cta() {
  return <ShimmerButton onClick={() => alert("Hi")}>Get started</ShimmerButton>;
}

Props

PropTypeDefaultDescription
childrenReactNodeThe label.
shimmerColorstring"rgba(255,255,255,0.35)"Colour of the band of light.
durationnumber2.4Seconds per sweep.
...propsbutton propsEvery native <button> prop: onClick, disabled, type and so on.

With reduced motion, the sweep is hidden.

On this page