Back to Components
Buttons
Add to Cart Button
E-commerce button with loading spinner, success checkmark, and animated state transitions.
Dependencies
- clsx
- tailwind-merge
- class-variance-authority
Files
- components/ui/add-to-cart-button.tsx
Installation
Using shadcn CLI
npx shadcn add add-to-cart-button --url https://ui.hampton.ioManual installation
Copy the component file to your project and install dependencies:
npm install clsx tailwind-merge class-variance-authority