A unified button component with motion animations, loading states, and icon support. Built on Radix UI Slot with Premium spring physics.
Copy the component source code into your project. Place this file at components/ui/button.tsx.
This will also install: motion-provider, icons
Six visual styles to match different contexts and actions.
Multiple size options for different contexts and layouts.
Add icons at the start or end of the button with smooth enter/exit animations.
Built-in loading spinner with automatic button disabling.
Show a success checkmark with animation after completing an action.
Material Design-inspired ripple effect on click for enhanced visual feedback. Automatically enabled on all variants except ghost and link.
currentColor, so it automatically adapts to your button's text color. It fades smoothly during loading and success state transitions.Square buttons for icon-only actions with required accessible labels.
Disable animations per-component or respect system reduced-motion preferences.
Merge button styles with any child element using Radix Slot.
Built with WCAG 2.1 guidelines. Keyboard and screen reader support included.
• Icon buttons require aria-label
• Loading states use aria-busy
• Spinners are aria-hidden
Motion Preferences
prefers-reduced-motion. Override with disableAnimation prop or MotionProvider.