# Ticket QR

A paper ticket with a perforated stub that prints its own code. While the ticket issues, the stub is a loose cloud of dots; when your app sets it to issued, the dots settle into a scannable QR code with Ready to scan and the ticket’s code under it. The code is drawn by the QR code part.

Kit part · With the Kit · https://tactileui.dev/parts/ticket-qr

> The code and styling for this part come with the Tactile UI Kit, which the Pass and the Founder Pass include. Sign in if you have it. Sign in: https://tactileui.dev/auth/sign-in The price: https://tactileui.dev/pricing

## Anatomy

The ticket is the kit’s paper.

## Variants

- Issued
- Issuing
- Without a seat

## States

- Issuing
- Issued

## Props and options

| Name | Kind | Description |
| - | - | - |
| value | attribute | The payload the code says. The part draws it with the QR code part: byte mode, error correction M. |
| state | attribute | Set by the app. Issuing shows the dots; issued settles them into the code. A missing state is issued. |
| event | attribute | The title on the ticket and the ticket’s name for a screen reader. |
| date · row · seat · gate | attribute | Row F · Gate B”. Leave one out and it is left out of the line. |
| code | attribute | The ticket’s code, printed under the QR code once it is issued. |
| level | attribute | The heading level of the title. |
| ticketQrHTML(options) · ticketQrFacts() · ticketQrSays() · ticketQrState() | function | The ticket as markup for a server or a still, the facts line, the status words and a safe state. |
| ticketQrGrid() · ticketQrCloud() · ticketQrPlace() · ticketQrProgress() | function | The modules as dot positions, the seeded cloud, where one dot is at a moment, and the ease of its travel. |

## Usage notes

The demo ticket issues again every few seconds. Your app sets state to issued when the ticket is ready.

## Accessibility

- Keyboard: nothing on the ticket needs a key; the code is plain selectable text, so it can also be copied by hand.
- The ticket is a labelled group (“Ticket: event”) with the title as a heading. One polite status line says “Issuing your ticket”, then “Ready to scan”.
- The dots are decorative and hidden from a screen reader.
- Where a finish’s paper is darker than its ink (Phosphor, AMOLED) the code plate is turned back to dark on light, so the code still scans. “Ready to scan” is words as well as a check mark.
- Reduced motion: the dots do not move. An issued ticket shows the finished code at once; an issuing one shows the dots still.

## Related parts

- [QR code](https://tactileui.dev/parts/qr-code): A QR code drawn as ink on the panel face, the value printed under it in mono and a key that copies it. Four modules of quiet zone are kept round the code, so a phone camera can find it.
- [Ticket toast](https://tactileui.dev/parts/ticket-toast): A toast issued like a numbered ticket from a dispenser. A short slip of thermal paper with a number, a line of words and, if it needs one, an action key slides out of a slot at the edge of the screen. Several fan a little. Tear one off with a swipe or its close key, or leave it and it retracts by itself, on a timer that stops while you are reading it.
- [Ticket punch](https://tactileui.dev/parts/ticket-punch): A checkbox drawn as a conductor’s ticket punch: each option is a paper ticket with a serial, and checking squeezes steel jaws shut on its box and leaves a shaped hole, with the paper chip falling away. A real checkbox underneath carries the value and the keyboard.
- [Receipt](https://tactileui.dev/parts/receipt): The record of a payment, printed on a slip of thermal paper: who was paid, the receipt number, when and with what, the lines and the sums, any refunds, and a rubber stamp that says where it stands, Paid, Part refunded, Refunded, Due or Void, with a lamp beside the word. It is what an order page, a billing history or the screen after checkout keeps; the order summary prices an order before it is paid. Under the slip are Print (only the slip goes to the printer), Download when there is a file, and Copy number. The sums are the order summary’s own, in whole minor units, never floating point.
