Componentdata0.45 KB gzipZero dependencies
ReceiptPrinter
Thermal printer that feeds mono receipt lines out of a printer slot with a stepped paper animation.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add receipt-printerOr install the full npm package:
npm install bigbulluiUsage
tsx7 lines
import { ReceiptPrinter } from "@/components/ui/receipt-printer"; <ReceiptPrinter lines={["DRINK", "1 Large Soda", "Fries on side"]} total="$8.50" autoFeed/>Source code
receipt-printer.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxreceipt-printer.tsx36 lines
import * as React from "react";import { cn } from "./lib/utils"; export interface ReceiptPrinterProps extends React.HTMLAttributes<HTMLElement> { lines: string[]; total?: string; autoFeed?: boolean; className?: string;} export function ReceiptPrinter({ lines = [], total, autoFeed = true, className, ...props }: ReceiptPrinterProps) { return ( <div className={cn( "relative size-80 overflow-hidden rounded-md border border-border bg-card p-4 motion-reduce:transition-none", className )} {...props} >Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { ReceiptPrinter } from "@/components/ui/receipt-printer"; <ReceiptPrinter />| Prop | Type | Description |
|---|---|---|
| lines | string[] | Configures lines. (Default: []) |
| total | string | Configures total. |
| autoFeed | boolean | Toggles auto feed. (Default: true) |
| className | string | Optional Tailwind or custom CSS classes merged with component styles. |