Docs
Star button
Star button
The StarButton is a visually striking button that features a radial light animation with a starry background.
Loading...
Installation
Install dependencies
npm install
Add utils file
lib/utils.ts
Add the following code in your tailwind.config.js file
tailwind.config.js
Copy the source code
star-button.tsx
Props
Prop | Type | Description | Default |
---|---|---|---|
className | String | The class name for the component, allowing for custom styling. | - |
lightWidth | Number | The diameter of the light halo (in px). | 120 |
duration | Number | The duration of the effect (in s). | 5 |
lightColor | String | The color of the light halo. | "#FAFAFA" |
children | React.ReactNode | The content inside the button, typically text or other elements. | - |
backgroundColor | String | The color for the background of the StarBackground SVG. | "currentColor" |