Docs
Gradient Button
Gradient Button
A dynamic button that features a vibrant gradient animation, smoothly transitioning between colors.
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
gradient-button.tsx
Props
Prop | Type | Description | Default |
---|---|---|---|
className | String | The class name for the component, allowing for custom styling. | - |
colorFrom | String | The starting color of the gradient animation. | #fc6a55 |
colorTo | String | The ending color of the gradient animation. | #f8c940 |
duration | Number | The duration of the gradient animation in seconds. | 2 |
children | React.ReactNode | The content inside the button, typically text or other elements. | undefined |