---
title: "Receipt Printer"
description: "An order receipt that prints line by line out of a thermal printer slot, then tears off on its serrated edge when you pull it down."
url: https://gelatinui.com/components/receipt-printer
markdown_url: https://gelatinui.com/components/receipt-printer.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/receipt-printer"
version: "2026-11-11"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Receipt Printer

> An order receipt that prints line by line out of a thermal printer slot, then tears off on its serrated edge when you pull it down.

Page: https://gelatinui.com/components/receipt-printer

## When to use it

Best for: A moment after a payment or a summary, where the paper itself is the reward.

- Put a `TillReceipt` with `edges="both"` in `ReceiptPrinterPaper`: its top teeth stay in the slot until a tear.
- Set `autoPrint={false}` when a press must start the print, as on a register.
- Add `ReceiptPrinterTearTrigger` so a keyboard can tear the paper off.

## When not to use it

- For a receipt that shows at once, with no printer, use a [Till Receipt](https://gelatinui.com/components/till-receipt.md).
- For a plain order summary in a page, use a [Card](https://gelatinui.com/components/card.md).

## Notes for agents

- The printer draws no receipt: pass any child to `ReceiptPrinterPaper`.
- A print feeds 10 lines a second and ends in about 6 s at most, then swings once.
- `onPrintEnd` runs when the paper rests; `onTear` runs on a tear by pull or by button.
- Printed paper takes the pull, so it blocks touch scroll on itself until it is torn.
- `ReceiptPrinterTrigger` fades a torn copy out and prints again.

## Anatomy

```text
ReceiptPrinter
├─ ReceiptPrinterSlot (0..n)
├─ ReceiptPrinterPaper (0..n)
├─ ReceiptPrinterTrigger (0..n)
└─ ReceiptPrinterTearTrigger (0..n)
```

## API reference

### ReceiptPrinter

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `autoPrint` | `boolean` | true | Prints the first time the paper comes into view. Default true. |
| `onPrintEnd` | `function` |  | Called when a print ends and the paper rests. |
| `onTear` | `function` |  | Called when the paper tears off: a long pull or `ReceiptPrinterTearTrigger`. |

### ReceiptPrinterSlot

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### ReceiptPrinterPaper

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### ReceiptPrinterTrigger

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `glass` | `"clear" \| "dark" \| "light"` |  |  |
| `rounded` | `"default" \| "full"` |  |  |
| `size` | `"default" \| "icon" \| "icon-lg" \| "icon-sm" \| "icon-xs" \| "lg" \| "sm" \| "xl" \| "xs"` |  |  |
| `variant` | `"dashed" \| "default" \| "destructive" \| "destructive-outline" \| "ghost" \| "link" \| "media" \| "outline" \| "secondary"` |  |  |
| `className` | `string` |  |  |
| `busy` | `boolean` |  | The button waits for the app (busy words): a spinner, `aria-busy`, and no clicks. Focus stays on the button. The style hook stays `data-loading`. |
| `spinnerPlacement` | `"center" \| "start"` |  | `center` (default): the spinner covers the label. `start`: it takes the leading icon slot. The icon sizes always use `center`, because their one icon is the label. |

Also takes every prop of Base UI `Button`: https://base-ui.com/react/components/button

### ReceiptPrinterTearTrigger

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `glass` | `"clear" \| "dark" \| "light"` |  |  |
| `rounded` | `"default" \| "full"` |  |  |
| `size` | `"default" \| "icon" \| "icon-lg" \| "icon-sm" \| "icon-xs" \| "lg" \| "sm" \| "xl" \| "xs"` |  |  |
| `variant` | `"dashed" \| "default" \| "destructive" \| "destructive-outline" \| "ghost" \| "link" \| "media" \| "outline" \| "secondary"` |  |  |
| `className` | `string` |  |  |
| `busy` | `boolean` |  | The button waits for the app (busy words): a spinner, `aria-busy`, and no clicks. Focus stays on the button. The style hook stays `data-loading`. |
| `spinnerPlacement` | `"center" \| "start"` |  | `center` (default): the spinner covers the label. `start`: it takes the leading icon slot. The icon sizes always use `center`, because their one icon is the label. |

Also takes every prop of Base UI `Button`: https://base-ui.com/react/components/button

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| ReceiptPrinter | `receipt-printer` | `data-phase`, `data-tearable` | `--radius`, `--receipt-printer-width` | `motion-timing` |
| ReceiptPrinterSlot | `receipt-printer-slot` | `data-phase`, `data-tearable` | `--radius`, `--receipt-printer-width` | `motion-timing` |
| ReceiptPrinterPaper | `receipt-printer-paper` | `data-phase`, `data-tearable` | `--radius`, `--receipt-printer-width` | `motion-timing` |
| ReceiptPrinterTrigger | `receipt-printer-trigger` |  |  |  |
| ReceiptPrinterTearTrigger | `receipt-printer-tear-trigger` |  |  |  |

## Usage

Put the printer body, the paper, and the buttons in the root.

The sample also uses `till-receipt`, which this add does not write. One command adds them with this item:

```bash
npx shadcn@latest add @gelatin-ui-pro/receipt-printer @gelatin-ui-pro/till-receipt
```

```tsx title="order-receipt.tsx"
import {
  ReceiptPrinter,
  ReceiptPrinterPaper,
  ReceiptPrinterSlot,
  ReceiptPrinterTearTrigger,
} from "@/components/pro/effects/receipt-printer";
import {
  TillReceipt,
  TillReceiptRow,
  TillReceiptRowLabel,
  TillReceiptRowValue,
  TillReceiptTitle,
} from "@/components/pro/labels/till-receipt";

export function OrderReceipt() {
  return (
    <ReceiptPrinter>
      <ReceiptPrinterSlot>Kettle & Crumb</ReceiptPrinterSlot>
      <ReceiptPrinterPaper>
        <TillReceipt aria-label="Kettle & Crumb receipt" className="w-full">
          <TillReceiptTitle>Kettle & Crumb</TillReceiptTitle>
          <TillReceiptRow variant="total">
            <TillReceiptRowLabel>Total</TillReceiptRowLabel>
            <TillReceiptRowValue>$41.55</TillReceiptRowValue>
          </TillReceiptRow>
        </TillReceipt>
      </ReceiptPrinterPaper>
      <ReceiptPrinterTearTrigger />
    </ReceiptPrinter>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui-pro/receipt-printer
```

It adds 29 registry items: 26 files, 4733 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `@xstate/react`, `motion`, `tailwind-merge`, `tailwind-variants`, `xstate`.

## Built on

- [Button](https://gelatinui.com/components/button.md)

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Button](https://gelatinui.com/components/button.md)
- [Card](https://gelatinui.com/components/card.md)
- [Price](https://gelatinui.com/components/price.md)
- [Till Receipt](https://gelatinui.com/components/till-receipt.md)
- [Barcode](https://gelatinui.com/components/barcode.md)

## Keyboard

| Keys | Action |
| --- | --- |
| Tab | Moves the focus to Print and to Tear off. |
| Enter, Space | On Print: prints the paper, or fades the old copy and prints again. On Tear off: tears the printed paper off. |

## Accessibility

The receipt is in the page from the start, so a screen reader reads it while it prints.

Tear off is the keyboard path of the pull. Both buttons stay in the tab order while they wait.

## Motion

| Part | Motion |
| --- | --- |
| Feed | progress · the paper leaves the slot in 18px steps, 10 to 14 a second, with a 0.6px head jitter |
| Settle | progress · the strip swings once on the slot, 1.2° at first, and rests in about 0.9 s |
| Tear | sheetRelease · a short pull springs back; a long pull drops the copy 24px with a 2° lean |
| Print again | fade · the torn copy fades out before the next print |
