# Receipt Printer

A small thermal receipt printer that prints any text, line by line. The paper feeds out from behind a serrated steel tear bar in the head's own rhythm, curls a little as it grows, and can be torn off: it rips along the teeth and falls away.

Object · With a Pass · https://tactileui.dev/objects/printer

> The code and styling for this object come with the Pass. Sign in if you have one. Sign in: https://tactileui.dev/auth/sign-in The price: https://tactileui.dev/pricing

## Anatomy

Line by line head, Stepper paper feed, Hinged row curl, Serrated tear clip, Gravity strip drop, Uneven thermal ink, Room fixed sheen, Sleeping loop

## Usage notes

Output that arrives as a physical process, for the places a product hands something over: an order confirmation, an AI answer printed line by line, a log, a checkout summary, a ticket. Everything printed is real text in the page, announced politely as it prints; Feed and Tear are buttons, and the paper can also be torn by dragging it down. A plain, small API (print, feed, tear, clear) with events for each line, for the end of a job and for the tear.

## Options

| Option | Type | Description |
| - | - | - |
| text | text | What it prints when it starts, and again when you change it. A \| starts a new line. Empty prints nothing, and the preview’s keys print a receipt, an answer, a log and a ticket. |
| width | number | Text is wrapped to it; the paper and the type follow. |
| speed | number | Fast lines with a small pause for each; a long line takes a little longer than a short one. |
| finish | enum | Auto follows the page: the housing is drawn from the page’s finish (white on a porcelain page, black on a black one); without the kit’s tokens, aluminium on a light page and graphite on a dark one. |
| paper | enum | Thermal is a warm off-white with the head’s fine dot grid; recycled is greyer and flecked. |
| curl | number | How much the paper remembers its roll: it bends toward you, more the further it is from the slot. |
| maxLength | number | Past this many lines the printer cuts the strip itself and it falls away; printing goes on onto a fresh sheet. |
| roll | number | 0 is a roll that never ends. Otherwise the lamp goes red when it is used up and printing waits; set it again to load a new roll. |
| light | number | Every highlight and shadow follows it, and the teeth catch it on one side. |
| sound | boolean | A soft thermal whirr for each line, a tick for each key and a rip for the tear. Synthesised, off by default, and only once you have touched the page; never under reduced motion. |
| label | text | Accessible name |

## Methods

- length
- busy
- print
- feed
- tear
- clear
- update
- destroy

## States

1. **Idle**: The lamp is green; nothing moves; the paper stays where it is.
2. **Printing**: The lamp is amber. Each line steps out a pixel row at a time, its ink coming with it, then the head rests for the rest of the beat; a long line takes a little longer, a rule or a blank half a beat.
3. **Curling**: The paper bends toward you, more the further it hangs from the slot; the rows are hinged edge to edge and the curled end catches the lamp.
4. **Tearing**: By the Tear key, a call, or a drag down past the resistance: a tug, a rip along the teeth, and the strip falls turning; its top edge is the bar's zigzag and a fresh sheet is already in the slot.
5. **Auto cut**: Past the paper length the printer cuts the strip itself and printing goes on.
6. **Out of paper**: When the roll's lines are used up the lamp goes red and printing waits; set a new roll and it goes on.
7. **Feeding**: The Feed key feeds two lines; held, it keeps feeding.
8. **Thermal and recycled**: Warm off-white stock with a faint fibre grain and the head's dot grid, or greyer flecked recycled stock.
9. **Aluminium**: A bead-blasted case, steel bar and lit legends.
10. **Graphite**: A soft-touch black case and a blackened bar.
11. **Sound**: Optional: a soft whirr for each line, a tick for each key, a rip for the tear. Off by default and only after the page has been touched.
12. **Off screen or hidden**: The queue holds and nothing runs.
13. **Reduced motion**: Text appears whole with no feeding; a tear removes the strip; no sound.

## How it works

Original. The paper is DOM and CSS: each printed line is a row of real text in a plane hinged to the one above, so the curl is a bend of the whole strip in perspective and the text stays selectable and readable. The tear bar and the torn edge share one zigzag polygon computed from the width.
