Shimmer Button
MotionA React call to action with a slow band of light sweeping across it, a lit top edge and a press state. Ink or accent tone, renders as a button or a link.
Installation
npx shadcn@latest add @minidev/shimmer-button
MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/shimmer-button.json
Usage
import { ShimmerButton } from "@/components/ui/shimmer-button"
export function Example() {
return (
<ShimmerButton />
)
}
API reference
| Prop | Type | Default |
|---|---|---|
| durationSeconds for one sweep. | number | 2.6 |
| toneInk is the kit's primary action; accent spends the brand violet. | "ink""accent" | "ink" |
| size`lg` (the default) is 48px tall, `default` is 40px. | "default""lg" | "lg" |
| renderRender as another element, e.g. <a href="/signup" /> or a router Link. Props and handlers are passed through. | React.ReactElement<Record<string, unknown>> | - |
Also accepts every prop of <button>, passed through to the root element.
When to use
Use it for the single most important action on a marketing page. Reach for Button in product UI, MagneticCta when the action should move toward the pointer, and BorderBeam or ShineBorder to light a whole card.
Accessibility
- A native
<button>(or yourrenderelement) with a 2pxfocus-visibleaccent ring. - The sweep and the lit top edge are
aria-hidden,pointer-events-nonespans, so onlychildrenare read. - Under reduced motion the sweep is not rendered at all.
Frequently asked questions
How do I make ShimmerButton a link?
Pass render: <ShimmerButton render={<a href="/signup" />}>Get started</ShimmerButton>, or a Next.js <Link href="/signup" />. Your other props and style are passed to that element, and className is merged with its own. No role="button" is added, so a link stays a link.
Will it submit my form?
Not by default: it renders <button type="button">. Pass type="submit" for a submit button. tone="accent" uses the brand colour; the default "ink" matches the kit's primary button.
Dependencies
npm
Built from
Examples
Tones
Ink is the default hero button; accent uses the brand colour for a single page-level action.
Sizes and speed
default is 40px for toolbars and cards; lg is 48px for heroes. duration sets seconds per sweep.
As a link
Pass render with an anchor and the same face wraps a real link.