@thai-qr-payment/render
v0.1.1
Published
SVG renderer for Thai QR Payment — composes payload + QR matrix + brand assets into a single scannable SVG card.
Maintainers
Readme
@thai-qr-payment/render
SVG renderer that composes Thai QR Payment payload + QR matrix + brand assets into a single scannable card. Built on @thai-qr-payment/payload, @thai-qr-payment/qr, and @thai-qr-payment/assets.
pnpm add @thai-qr-payment/renderQuickstart
import { renderThaiQrPayment } from '@thai-qr-payment/render';
const svg = renderThaiQrPayment({
recipient: '0812345678',
amount: 50,
merchantName: 'Acme Coffee',
amountLabel: '฿ 50.00',
errorCorrectionLevel: 'H',
});
// Serve via a Cloudflare Worker, Node HTTP handler, or write to disk.
return new Response(svg, { headers: { 'content-type': 'image/svg+xml; charset=utf-8' } });Just the QR (no card chrome)
import { renderThaiQrPaymentMatrix } from '@thai-qr-payment/render';
const svg = renderThaiQrPaymentMatrix({
recipient: '0812345678',
amount: 50,
size: 256, // px
quietZone: 4,
});Card options
| Option | Default | Notes |
| --------------- | ------------------------- | ---------------------------------------------------- |
| theme | color | silhouette swaps brand artwork to monochrome paths |
| merchantName | — | Rendered above the QR |
| amountLabel | — | Free-form THB string rendered below the QR |
| background | #fff | Card backdrop |
| accent | #0a2540 | Text + silhouette fill colour |
| headerLogo | Thai_QR_Payment_Logo-01 | Override from @thai-qr-payment/assets |
| promptpayLogo | PromptPay1 | Override |
License
MIT
