Components / Buttons
Shimmer Button
A button with a streak of light that sweeps across it on a loop.
Installation
Requires React 18+ and Tailwind CSS.
- 1
Install dependencies
$ npm install motion - 2
Add the component
Copy the code from the Code tab above into
components/ui/shimmer-button.tsx. - 3
Use it
example.tsximport { ShimmerButton } from "@/components/ui/shimmer-button"; export default function ShimmerButtonDemo() { return <ShimmerButton>Get started for free</ShimmerButton>; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| shimmerColor | string | "rgba(255,255,255,0.45)" | Color of the light streak. |
| duration | number | 2.2 | Seconds for one sweep. |
| ...props | ComponentProps<"button"> | — | Any native button prop. |