# Shimmer Button

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

- Kind: Motion component (Motion)
- Docs: https://ui.minidev.pro/docs/shimmer-button
- Source (registry JSON with the full file): https://ui.minidev.pro/r/shimmer-button.json
- License: MIT. One file, yours to edit after install.

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

## Installation

### shadcn CLI (copies the source into your project)

```bash
npx shadcn@latest add @minidev/shimmer-button
```

Writes `components/ui/shimmer-button.tsx` and installs its npm dependencies. Older CLI versions: `npx shadcn@latest add https://ui.minidev.pro/r/shimmer-button.json`.

### npm package

```bash
npm i minidev-ui-kit lucide-react motion
```

Add the tokens to your global stylesheet once:

```css
@import "tailwindcss";
@import "minidev-ui-kit/styles.css";
@source "../node_modules/minidev-ui-kit";
```

Next.js also needs `transpilePackages: ["minidev-ui-kit"]` in next.config.

## Import

After the shadcn install:

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

From the npm package:

```tsx
import { ShimmerButton } from "minidev-ui-kit/premium/shimmer-button"
```

## Usage

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

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

## Props

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `duration` | `number` | `2.6` | no | Seconds for one sweep. |
| `tone` | `"ink" \| "accent"` | `"ink"` | no | Ink is the kit's primary action; accent spends the brand violet. |
| `size` | `"default" \| "lg"` | `"lg"` | no | `lg` (the default) is 48px tall, `default` is 40px. |
| `render` | `React.ReactElement<Record<string, unknown>>` | - | no | Render as another element, e.g. <a href="/signup" /> or a router Link. Props and handlers are passed through. |

Also accepts every prop of `<button>`, passed through to the root element.

## Examples

### Tones

Ink is the default hero button; accent uses the brand colour for a single page-level action.

```tsx
<ShimmerButton>Start free trial <ArrowRightIcon className="size-4" /></ShimmerButton>
<ShimmerButton tone="accent">Upgrade to Pro <SparklesIcon className="size-4" /></ShimmerButton>
```

### Sizes and speed

default is 40px for toolbars and cards; lg is 48px for heroes. duration sets seconds per sweep.

```tsx
<ShimmerButton size="default" duration={2}>Book a demo</ShimmerButton>
<ShimmerButton size="lg" duration={4}>Book a demo</ShimmerButton>
```

### As a link

Pass render with an anchor and the same face wraps a real link.

```tsx
<ShimmerButton render={<a href="#pricing" />}>
  See pricing <ArrowRightIcon className="size-4" />
</ShimmerButton>
```

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

## FAQ

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

## Rules for generating code

- Use semantic tokens only (bg, surface, sunken, border, fg, fg-muted, fg-subtle, ink, accent, success, warning, danger). Never raw hex or palette steps like blue-500.
- Shadows only from the set: shadow-xs, shadow-sm, shadow-raised, shadow-md, shadow-lg, shadow-overlay.
- Numbers use tabular-nums. Dark mode is the `dark` class on <html>; components never branch on theme.

## Dependencies

- npm: `lucide-react`, `motion`

## Related

- [Button](https://ui.minidev.pro/docs/button/md): Shadcn compatible React button on Base UI with eight variants, nine sizes including icon sizes, a pressed state and render prop support for links.
- [Magnetic Cta](https://ui.minidev.pro/docs/magnetic-cta/md): A magnetic button that drifts toward the cursor on a spring and snaps back on leave. Takes all Button props plus a strength value; static for reduced motion.
- [Border Beam](https://ui.minidev.pro/docs/border-beam/md): React border beam: a light that travels around any card's border, drawn as a masked conic gradient in your accent colors. Pauses for reduced motion.
- [Shine Border](https://ui.minidev.pro/docs/shine-border/md): React shine border: a conic gradient sweeps around a card's edge, masked to the border ring so content stays untouched. Colors, duration and width props.
- [Animated Feature Row](https://ui.minidev.pro/docs/animated-feature-row/md): A row of feature cards that slide up with a staggered delay when scrolled into view. Pass title and description pairs; reduced motion keeps them still.
- [Card Tilt](https://ui.minidev.pro/docs/card-tilt/md): A card that tilts in 3D toward the pointer on springs, with an accent glare that follows the cursor. It stays flat when reduced motion is preferred.

---

All 557 components: https://ui.minidev.pro/llms.txt (full text: https://ui.minidev.pro/llms-full.txt).
