Click Spark
Short lines radiate from every click and fade as they fly out. Draws only while a burst is alive.
- Category: Cursor
- Licence: Free, MIT
- Built with: React 19, Tailwind CSS 4, Motion
- Dependencies: motion, clsx, tailwind-merge
Examples
Click Spark
Click the empty space or the buttons.
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | |
count | number | 8 | Spark lines per click. |
length | number | 22 | Length of each line in px. |
duration | number | 0.45 | Seconds for a burst to fly out and fade. |
color | string | "var(--ember)" | |
className | string | — |
About Click Spark
Click Spark radiates short lines from every click that fade as they fly out. It is a tiny reward for interaction that works anywhere you wrap it.
Click Spark is a cursor effect for React 19, styled with Tailwind CSS 4 and animated with Motion. It drops into Next.js, Vite, Remix or Astro through the shadcn CLI as a single file you own.
When to use Click Spark
- Buttons and calls to action.
- Games and quizzes.
- Celebration moments.
- Playful UIs.
How it works
Sparks are drawn on a canvas only while a burst is alive, so it idles at zero cost. count, length and colour are props.
It only reacts to a mouse, never hides the real cursor unless you ask it to, and does nothing on touch screens. With prefers-reduced-motion on, it holds still or settles instantly instead of animating.
Customizing Click Spark
Every prop is documented in the API reference above with its type and default. The ones you will reach for first are listed here.
The Customize panel next to the preview lets you change count, length, duration, color live, and the Code tab updates to match, so the snippet you copy already carries your values.
- count (number, default 8): Spark lines per click.
- length (number, default 22): Length of each line in px.
- duration (number, default 0.45): Seconds for a burst to fly out and fade.
- color (string, default "var(--ember)").
The example on this page
- Click Spark: Click the empty space or the buttons.
Goes well with Click Spark
These cursor pieces share its tokens and motion language, so they sit together on one page without clashing.
- Cursor Trail: A React cursor trail: sparks fly off the pointer, drift down and cool
- Blob Cursor: A React blob cursor that trails the pointer and swells over links
- Spotlight Reveal: A React spotlight reveal: the pointer cuts a circle to show hidden content
- Image Trail: A React image trail: photos drop along the pointer path and fade
- Cursor Label: A React cursor label: a pill that follows the pointer and says View or Play
Install Click Spark
npx shadcn@latest add https://charcoalui.com/r/click-spark.jsonClick Spark is free and MIT licensed. The command copies click-spark.tsx into components/ui and installs clsx, tailwind-merge; you can also copy the source from the Code tab by hand.
Charcoal UI Pro adds 300 more showpiece components, 107 sections and 100 templates built the same way.
Frequently asked questions
- Does click spark cost anything when idle?
- No. It only draws while a burst is alive, then stops, so it can wrap a whole page without a running loop.
- How do I install Click Spark?
- Run npx shadcn@latest add https://charcoalui.com/r/click-spark.json. The shadcn CLI copies click-spark.tsx into components/ui and installs motion, clsx, tailwind-merge. You can also copy the source from this page by hand.
- Is Click Spark free for commercial use?
- Yes. Click Spark is MIT licensed: use it in any personal or commercial project and change it however you like.
- Does Click Spark work with Next.js?
- Yes. It is a client component for React 19 styled with Tailwind CSS 4, so it works in the Next.js App Router and Pages Router, Vite, Remix and Astro.
- Can an AI coding agent install Click Spark?
- Yes. Connect the Charcoal UI MCP server (https://charcoalui.com/mcp) to Claude Code, Cursor or any MCP client; get_component returns Click Spark's props and source and get_install_command returns the exact command.