A modern, animated, and accessible call-to-action button featuring spinning conic gradients, smooth transitions, and comprehensive customization. Ideal for landing pages, feature cards, or anywhere you want to draw attention with eye-catching interaction.
You can install the AnimatedButton component with the following CLI command, or copy the implementation manually:
1npx shadcn@latest add http://localhost:3000/r/animated-button.jsonTo use the AnimatedButton component, import it in your code:
1import AnimatedButton from '@/components/AnimatedButton';The AnimatedButton component accepts the following props:
| Prop | Type | Default | Description | Required |
|---|---|---|---|---|
children | string | - | The text displayed inside the button. | Yes |
onClick | () => void | - | Callback fired when the button is clicked. | Yes |
className | string | - | Additional utility classes for customizing the button styling. | No |
type | 'button' | 'submit' | 'reset' | 'button' | Type of button. | No |
ariaLabel | string | - | Aria-label for accessibility; defaults to the button text. | No |
disabled | boolean | false | Whether the button is disabled. | No |
1<AnimatedButton onClick={() => alert('Hello!')}>Click me</AnimatedButton>1<AnimatedButton className="bg-sky-100 dark:bg-slate-800" onClick={() => alert('Styled!')}>Custom</AnimatedButton>1<AnimatedButton disabled onClick={() => {}}>Can't Click</AnimatedButton>aria-label and disabled for improved accessibility.className.h-12 w-32, rounded-full, etc) for different form factors.[animation-duration:2s] utility for slower or faster spins.div (e.g., background, padding, text styles).[background-image:...] and [animation-...] syntax (see Tailwind’s config docs).children and an onClick function.