Components
Shimmer Button
A button with light sweeping across it.
<ShimmerButton>
Get started
</ShimmerButton>Installation
npx shadcn@latest add https://ui.zjkm.tech/r/shimmer-button.jsonimport { 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
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | The label. | |
shimmerColor | string | "rgba(255,255,255,0.35)" | Colour of the band of light. |
duration | number | 2.4 | Seconds per sweep. |
...props | button props | Every native <button> prop: onClick, disabled, type and so on. |
With reduced motion, the sweep is hidden.