
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
sparkle-button
Advanced tools
A customizable, animated circular button component for React applications. The SparkleButton features an icon in the center, surrounded by sparkles that animate in a clockwise rotation. The button has customizable colors, sizes, and sparkles.

To install the SparkleButton package, run:
npm install sparkle-button
Or if using yarn:
yarn add sparkle-button
First, import the SparkleButton component:
import SparkleButton from 'sparkle-button';
Then, use the SparkleButton component in your React application:
<SparkleButton />
You can customize various aspects of the SparkleButton component, such as the icon, size, colors, and more. Here are some examples:
NOTE: If there is an issue with the size not working correctly you may have to remove the "width=" attribute from the svg To change the SVG icon, pass the icon prop to the SparkleButton component:
const rocketIcon = (
<svg viewBox="0 0 512 512">
<path d="M505.12019,19.09375c-1.18945-5.53125-6.65819-11-12.207-12.1875C460.716,0,435.507,0,410.40747,0,307.17523,0,245.26909,55.20312,199.05238,128H94.83772c-16.34763.01562-35.55658,11.875-42.88664,26.48438L2.51562,253.29688A28.4,28.4,0,0,0,0,264a24.00867,24.00867,0,0,0,24.00582,24H127.81618l-22.47457,22.46875c-11.36521,11.36133-12.99607,32.25781,0,45.25L156.24582,406.625c11.15623,11.1875,32.15619,13.15625,45.27726,0l22.47457-22.46875V488a24.00867,24.00867,0,0,0,24.00581,24,28.55934,28.55934,0,0,0,10.707-2.51562l98.72834-49.39063c14.62888-7.29687,26.50776-26.5,26.50776-42.85937V312.79688c72.59753-46.3125,128.03493-108.40626,128.03493-211.09376C512.07526,76.5,512.07526,51.29688,505.12019,19.09375ZM384.04033,168A40,40,0,1,1,424.05,128,40.02322,40.02322,0,0,1,384.04033,168Z" />
</svg>
);
<SparkleButton icon={rocketIcon} />
![]()
To change the size of the button, pass the size prop to the SparkleButton component:
<SparkleButton size={60} />
The size prop accepts a number representing the diameter of the button in pixels.

You can customize the background and icon colors by passing the backgroundColor, hoverBackgroundColor, activeBackgroundColor, and iconColor props:
<SparkleButton
backgroundColor="#333"
hoverBackgroundColor="#555"
activeBackgroundColor="#222"
iconColor="#FFF"
/>

To customize the sparkles, pass the sparkleColors prop to the SparkleButton component:
<SparkleButton sparkleColors={['red', 'yellow', 'green', 'fuchsia', 'white', 'pink', 'PaleGreen', 'SlateGray']} />
The sparkleColors prop accepts an array of color strings.

To customize the icon's position within the button, pass the iconOffsetX and iconOffsetY props:
<SparkleButton iconOffsetX={-2} iconOffsetY={3} />
The iconOffsetX and iconOffsetY props accept numbers representing the horizontal and vertical offset in percentages, respectively.
![]()
To make the sparkles stop animating after the button is clicked, pass the stopSparklesOnClick prop:
<SparkleButton stopSparklesOnClick />

| Prop | Type | Required | Description | Default Value |
|---|---|---|---|---|
icon | ReactNode | No | The SVG icon or React component to display in the center of the button | Rocket Icon |
size | number | No | The diameter of the button in pixels | 60 |
backgroundColor | string | No | The background color of the button | '#333' |
hoverBackgroundColor | string | No | The background color of the button when hovered | '#555' |
activeBackgroundColor | string | No | The background color of the button when active (pressed) | '#222' |
iconColor | string | No | The color of the icon | '#FFF' |
sparkleColors | Array | No | An array of color strings for the sparkles | (see below) |
iconOffsetX | number | No | The horizontal offset of the icon in percentage | 0 |
iconOffsetY | number | No | The vertical offset of the icon in percentage | 0 |
stopSparklesOnClick | boolean | No | If true, the sparkles will stop animating when the button is clicked | false |
Default sparkleColors:
['red', 'yellow', 'green', 'fuchsia', 'white', 'pink', 'PaleGreen', 'SlateGray']
This project is licensed under the MIT License.
FAQs
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.