Skip to content

@thermal-print

Thermal Printing for
|

A modular TypeScript library suite for thermal printing with clean, standalone architecture.

thermal-print demo

Quick Example

tsx
import {
  Document,
  Page,
  Text,
  View,
  convertToESCPOS,
} from "@thermal-print/react";

function Receipt() {
  return (
    <Document>
      <Page>
        <Text style={{ fontSize: 20, textAlign: "center", fontWeight: "bold" }}>
          MY STORE
        </Text>
        <View style={{ flexDirection: "row", justifyContent: "space-between" }}>
          <Text>Coffee</Text>
          <Text>$3.50</Text>
        </View>
      </Page>
    </Document>
  );
}

// Convert to ESC/POS and print
const buffer = await convertToESCPOS(<Receipt />, { paperWidth: 48 });
await printer.write(buffer);

Released under the MIT License.