# Receipt Printer

A receipt that prints line by line, then tears off and falls when you pull it, built with React.

Install with Agentbunn

Open in Code Block

```bash
npx shadcn@latest add https://kokonutui.com/r/receipt-printer.json, then show me how to use it.
```

---

## Order Summary

KOKONUT COFFEE

Order #4182

---

| Item               | Quantity | Price |
|---------------------|----------|-------|
| Flat white          | 2        | 9.00  |
| Almond croissant    | 1        | 3.80  |
| Oat milk           | 2        | 1.20  |
| Banana bread        | 1        | 3.20  |

---

Subtotal: $17.20

Tax 8%: $1.38

Total: $18.58

Thank you, come again

---

## Installation

Receipt Printer is a free, open-source React component in the Kokonut UI Cards collection. Add it with the shadcn CLI, which copies the source into `components/kokonutui/receipt-printer.tsx`, so the code is yours to change.

---

Copy Text:

```bash
npx shadcn@latest add @kokonutui/receipt-printer
```

## Usage

Copy Text:

```javascript
import ReceiptPrinter from "@/components/kokonutui/receipt-printer";

export default function Example() {
  return <ReceiptPrinter />;
}
```

## Props

- **merchant**
  - `string`  
  - Default: "Kokonut Coffee"
- **order**
  - `string`  
  - Default: "#4182"
- **date**
  - `string`  
  - Default: "14 Oct 2026 · 08:42"
- **items**
  - `ReceiptItem[]`  
  - Default: built-in
- **tax**
  - `number`  
  - Default: 0.08  
  - Tax rate, 0.08 for 8%.
- **currency**
  - `string`  
  - Default: "$"
- **autoPrint**
  - `boolean`  
  - Default: true  
  - Print as soon as the printer scrolls into view.
- **onPrint**
  - `() => void`
- **onTear**
  - `() => void`
- **className**
  - `string`  
  - Extra classes for the root element.

### ReceiptItem

- **name**  
  - `required`
  - `string`
- **quantity**  
  - `required`
  - `number`
- **price**  
  - `required`
  - `number`

## Dependencies

| Needs                              | Version | Comes from   |
|------------------------------------|---------|--------------|
| `cn` from `lib/utils.ts`           |         | shadcn init  |
| React                               | `19`    | Your app     |
| Tailwind CSS                        | `4`     | Your app     |

No provider, font or global CSS to set up: the file works as soon as it lands.
