Ticket
Admission-style surface with a colored header, flexible body, and perforated footer stub.
Install
npx shadcn@latest add @jbm/ticketNeeds the @jbm entry in components.json; see Install once.
Also installs @jbm/tokens.
Usage
import { Ticket } from "@/jbm/ui/ticket"<Ticket header="ADMIT ONE · OCT 2026" stub="Tu nombre · Tu comunidad" tone="accent"> <h3>Un lugar para crear.</h3> <p>Trae tu curiosidad.</p></Ticket>import { Ticket } from "@/jbm/ui/ticket"<Ticket header="orden de trabajo" stub={<>Hecho es:<br />Las pruebas pasan.</>}> <h3>Migrar los pagos</h3> <p>Del cliente anterior al nuevo.</p></Ticket>Props
- Stage
fluidWidth fills the container; height follows content: header band (14px padding × 2 + one 12px mono line), body (24px padding × 2 + children), and stub (16px padding × 2 + 12px × 1.5 lines), plus the card border. Set style.width for a fixed ticket.
A card-stock surface (shared card border, shadow, and radius tokens) with an optional ink or vermilion mono header band, a 24px-padded body for arbitrary children, and an optional stub below a dashed perforation line. Content semantics belong to the caller; div attributes pass through.
| Prop | Type | Default | Description |
|---|---|---|---|
header | React.ReactNode | none | Optional header band content (12px mono, cream text). Omit (null/undefined) to hide the band. |
stub | React.ReactNode | none | Optional footer stub content (12px dim mono) below a dashed line. Omit to hide. |
tone | "ink" | "accent" | "ink" | Header band fill: "ink" or the vermilion "accent". |
Also accepts React.HTMLAttributes<HTMLDivElement>.
QA checks
- Toggle the Vermilion header control: the band switches between accent and ink while body and stub are unchanged.
- Check the rounded corners clip the header band and the dashed perforation spans the full width above the stub.
- Remove header or stub and confirm no empty band or dashed line remains.
- Check long content on a narrow screen wraps inside the ticket (overflowWrap anywhere) and the surface border and shadow match Card.