Skip to content

Shimmer Button

Motion

A 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.

src/registry/premium/shimmer-button.tsx/r/shimmer-button.json

Installation

bash
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

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

export function Example() {
  return (
    <ShimmerButton />
  )
}

API reference

ShimmerButton props
PropTypeDefault
durationSeconds for one sweep.number2.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 your render element) with a 2px focus-visible accent ring.
  • The sweep and the lit top edge are aria-hidden, pointer-events-none spans, so only children are 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

lucide-reactmotion

Built from

No other MiniDev files

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.

All Animated React components

Learn more