Shimmer button
A primary button with a band of light that sweeps across it once when it is hovered or focused by keyboard. Use it for the one action a page wants noticed, such as an upgrade. Everywhere else use the button: two of these on one screen cancel each other out.
Install
npx shadcn@latest add @thrum-pro/shimmer-buttonThis is a Pro component. The command works once your project has a licence key: set up Pro or see pricing.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
size | "sm" | "md" | "lg" | Default "md" | sm is 28 pixels tall, md 32, lg 40. |
loop | boolean | Default false | Keep the sheen sweeping, once every 2.8 seconds, instead of once per hover or focus. |
paused | boolean | Default false | Freeze the sheen where it is, and start no new sweep. |
disabled | boolean | Default false | The native attribute. A disabled button does not sweep, with or without loop. |
type | "button" | "submit" | "reset" | Default "button" | The native type. Set submit inside a form. |
className | string | – | Extra classes, merged last. |
...props | ComponentProps<"button"> | – | Every other button attribute and event handler is passed through. |
Motion and sound
Motion
- On hover, and on keyboard focus, a band of light half as wide as the button crosses it from left to right in 700 ms. A sweep that is running is left to finish before another starts.
- The band is the primary text colour at up to 25%, so it shows on any theme: a light sweep on a dark primary colour, a shade on a light one.
- With loop it sweeps for 700 ms, rests for 2.1 seconds, and repeats. paused freezes it where it is.
- The sweep runs through the browser's Web Animations API. It needs no keyframes in your stylesheet and adds no style element, so a strict content security policy allows it.
- Hover and press also change the colour and scale the button to 97%, over 150 ms, as on the button.
- Reduced motion: there is no sweep, with or without loop. A disabled button does not sweep either.
Sound
Silent. This component makes no sound.
Accessibility
- It is a native button, named by its text. The sheen is hidden from screen readers and takes no pointer events.
- The sheen passes behind the label, at no more than a quarter of the label colour's strength, and is gone in under a second.
- A loop keeps moving for as long as the page is open, which draws the eye away from reading. Leave it off unless the page is about that one action, and offer paused where it runs longer than 5 seconds.
- At rest, and under reduced motion, a static diagonal sheen marks the button without moving.
| Keys | Action |
|---|---|
| Tab | Focus the button. The sheen sweeps once. |
| Enter / Space | Press the button. |
Source
The source comes with Pro
TypeScript source · Copy-paste ready · MIT-compatible for client projects · Includes all dependencies
Files and dependencies
- Adds
components/ui/shimmer-button.tsx- Packages
motion- Brings along
- ButtonMotion tokens
Changelog
- 1.0.0 · 2026-12-03First release.