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
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add receipt-printer

Or install the full npm package:

npm install bigbullui

Usage

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 helper

Zero 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 />
PropTypeDescription
linesstring[]Configures lines. (Default: [])
totalstringConfigures total.
autoFeedbooleanToggles auto feed. (Default: true)
classNamestringOptional Tailwind or custom CSS classes merged with component styles.