---
title: "Click Burst"
description: "Wrap any clickable element and each click throws a small burst of stars and dots from the point you click: a moment of delight on a check, a like or a save."
category: "Micro Interactions"
publishedAt: "2026-11-25"
updatedAt: "2026-11-25"
documentation: "https://beui.dev/micro-interactions/click-burst"
markdown: "https://beui.dev/micro-interactions/click-burst.md"
license: "MIT"
---

# Click Burst

> Wrap any clickable element and each click throws a small burst of stars and dots from the point you click: a moment of delight on a check, a like or a save.

## Install

```bash
npx shadcn@latest add @beui/click-burst
```

## Dependencies

- `clsx`
- `motion`
- `react`
- `tailwind-merge`

## Usage

```tsx
"use client";

import { Heart } from "lucide-react";
import { useState } from "react";
import { ClickBurst } from "@/components/motion/click-burst";

export function ClickBurstUsage() {
  const [liked, setLiked] = useState(false);

  return (
    // Bursts from the click point, only when liking.
    <ClickBurst enabled={!liked}>
      <button
        type="button"
        aria-pressed={liked}
        aria-label="Like"
        onClick={() => setLiked((value) => !value)}
        className="grid size-10 place-items-center rounded-full border border-border"
      >
        <Heart className={liked ? "size-4 fill-rose-500 text-rose-500" : "size-4"} />
      </button>
    </ClickBurst>
  );
}
```

## API Reference

### ClickBurst

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `children` | `ReactNode` | — | Yes | The element to burst from: a checkbox, a button, a card. Its own clicks still work. |
| `enabled` | `boolean` | `true` | No | Whether a click bursts right now, e.g. only when a task is being checked, not unchecked. Default: true |
| `origin` | `"center" \| "pointer"` | `pointer` | No | Where the burst starts: the click point, or the wrapper's centre. Keyboard clicks always use the centre. Default: "pointer" |
| `count` | `number` | `12` | No | How many pieces fly out. Default: 12 |
| `spread` | `number` | `34` | No | How far the pieces fly, in px. Default: 34 |
| `colors` | `string[]` | `["#10b981", "#f59e0b", "#38bdf8", "var(--primary)"]` | No | Piece colours, any CSS colour. Default: green, amber, sky and the theme's primary colour |
| `className` | `string` | — | No | Classes merged onto the root element. |

## About Click Burst

Click Burst is a React click effect built with Framer Motion. Wrap any clickable element, such as a checkbox, a like button or a save button, and each click throws a small burst of four-point stars and dots from the exact point you clicked. The pieces pop out in a ring, spin and shrink as they slow, and fade, in about half a second. The child keeps all its own behaviour; Click Burst only listens for its clicks. Set enabled to burst on some clicks only, such as checking a task but not unchecking it.

### When to use it

- Ticking a task, finishing a step or completing a habit should feel rewarding.
- A like, star or save button wants a small moment of delight.
- A game, quiz or streak marks a correct answer.

### Accessibility

The burst is drawn on a layer that is hidden from assistive technology and never takes pointer events, so the wrapped control works and is announced exactly as before. A click from the keyboard bursts from the element's centre. With reduced motion nothing is drawn.

### FAQ

**How do I burst only when a checkbox is checked?**

Pass enabled={!checked}. The value is read at the moment of the click, before the checkbox changes, so checking bursts and unchecking does not.

**Can I change the colours and size?**

Pass colors as CSS colours, count for the number of pieces and spread for how far they fly in px. Set origin to center to burst from the middle instead of the click point.

## Source

- Registry detail: https://beui.dev/r/click-burst
- Raw source: https://beui.dev/r/click-burst/raw
- GitHub: https://github.com/starc007/ui-components
