# Receipt Printer

A receipt that feeds out of a slot line by line, hangs, and tears off on a pull.

Tier: Free

## Installation

```bash
npx shadcn add @fetaui/receipt-printer
```

## Usage

```tsx
import { ReceiptPrinter } from '@/components/fetaui/receipt-printer'

export function Example() {
  return <ReceiptPrinter shop="Feta Coffee" items={items} onStateChange={track} />
}
```

## API

| Prop | Type | Default |
|---|---|---|
| shop | string | Feta Coffee |
| date | string |  |
| order | string |  |
| items | { quantity, name, price }[], where price is the line total |  |
| taxRate | number | 8 |
| currency | string | $ |
| thanks | ReactNode |  |
| state | idle, printing, hanging, torn |  |
| defaultState | idle, printing, hanging, torn | idle |
| onStateChange | (state) => void |  |
| frozen | boolean | false |
| animated | boolean | true |

## When to use

- For a transactional moment worth marking, like a finished order.
- When the receipt itself is the confirmation.

## When not to use

- For a billing history: use Table.
- Where the total has to be read at a glance without the moment.

## Accessibility

- An article named after the shop, with every line as real text.
- Status changes are announced politely.
- Tearing also has a Button, so a drag is never required.
- The barcode is decorative.

## Motion

- Paper feeds out at 40 ms per line, stepping one line at a time.
- The Button loads until the last line lands.
- A pull past 40 px tears it, and it drops and tilts on a spring.
- With reduced motion, the receipt appears complete.
