---
title: "Add to Cart | Free React & Tailwind Craft Component | Motion UI"
canonical: "https://blacknest.dev/motion/c/craft/add-to-cart-button"
github_source: "https://github.com/Rkj0123/motion-ui-skill/blob/main/components/buttons/add-to-cart-button.tsx"
install_command: "npx motion-ui-skill add add-to-cart-button"
dependencies: ["clsx","lucide-react","react","tailwind-merge"]
category: "craft"
subcategory: "buttons"
---

# Add to Cart

> Raised 3D add-to-cart key that sinks in while adding, with gentle label crossfades, then pops back up in a solid emerald added state before resetting.

## Install

```bash
npx motion-ui-skill add add-to-cart-button
```

## Dependencies

- `clsx`
- `lucide-react`
- `react`
- `tailwind-merge`

## Usage

```tsx
"use client";

import { AddToCartButton } from "@/components/buttons/add-to-cart-button";

export function AddToCartButtonDemo() {
  return (
    <div className="flex items-center justify-center p-6">
      <AddToCartButton />
    </div>
  );
}
```

## API Reference

### AddToCartButton

| Prop | Type | Default | Required | Description |
| :--- | :--- | :--- | :--- | :--- |
| `className` | `string` | — | No | Additional CSS classes |

## Source Files

- [components/buttons/add-to-cart-button.tsx](https://github.com/Rkj0123/motion-ui-skill/blob/main/components/buttons/add-to-cart-button.tsx)
- [lib/cn.ts](https://github.com/Rkj0123/motion-ui-skill/blob/main/lib/cn.ts)
- [lib/utils.ts](https://github.com/Rkj0123/motion-ui-skill/blob/main/lib/utils.ts)
