Skip to content

shashi089/qr-code-layout-generate-tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

104 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

QR Layout Tool

The open-source QR code label designer for developers. Design once, print everywhere.

License: MIT npm version npm version npm downloads npm downloads TypeScript GitHub Stars

If this project saves you time, please consider giving it a ⭐ β€” it helps others find it!


πŸš€ Live Demos

Try the designer live β€” no signup required:

Framework Live Demo Source Code
React β–Ά Open Demo Source
Angular β–Ά Open Demo Source
Svelte 5 β–Ά Open Demo Source
Vue 3 β–Ά Open Demo Source

QR Layout Designer Screenshot


πŸ“– What Is This?

QR Layout Tool is a complete solution for building applications that generate dynamic, printable QR code labels, stickers, and badges. Unlike basic QR generators that produce a single image, this tool gives you a full layout engine with a visual designer, data binding, and multi-format export.

It is split into two focused npm packages:

Package Purpose
qrlayout-core Headless rendering engine β€” use in any JS/TS project
qrlayout-ui Embeddable drag-and-drop visual designer

Why choose QR Layout Tool?

  • πŸ–¨οΈ Industrial-grade output: Direct ZPL export for Zebra thermal printers
  • πŸ“¦ Mail-merge style batching: Generate thousands of unique labels from one template with {{variable}} syntax
  • 🌐 Truly framework-agnostic: Works with React, Vue, Angular, Svelte, or plain HTML β€” no framework lock-in
  • πŸ“„ Multi-format: High-fidelity PDF, PNG, and ZPL from the same layout definition
  • ⚑ Lightweight: Zero heavy dependencies in qrlayout-core; renders on Canvas in the browser or Buffer in Node.js

πŸ›  Tech Stack

React Angular Svelte Vue TypeScript Node.js


⚑ Quick Start

Option 1: Headless (Core only)

Use the rendering engine directly β€” no UI needed.

npm install qrlayout-core
import { StickerPrinter } from "qrlayout-core";

const printer = new StickerPrinter();

const layout = {
  id: "badge",
  name: "Employee Badge",
  width: 100, height: 60, unit: "mm",
  elements: [
    { id: "name", type: "text", x: 5, y: 5, w: 90, h: 12, content: "{{name}}", style: { fontSize: 16, fontWeight: "bold" } },
    { id: "qr",   type: "qr",   x: 35, y: 20, w: 30, h: 30, content: "{{id}}" }
  ]
};

// Batch generate 3 labels and export to ZPL for a thermal printer
const zplPages = printer.exportToZPL(layout, [
  { name: "Alice",   id: "EMP-001" },
  { name: "Bob",     id: "EMP-002" },
  { name: "Charlie", id: "EMP-003" },
]);

Option 2: Embedded Visual Designer (UI)

Drop a full drag-and-drop designer into any web app.

npm install qrlayout-ui qrlayout-core
import { QRLayoutDesigner } from "qrlayout-ui";
import "qrlayout-ui/style.css";

const designer = new QRLayoutDesigner({
  element: document.getElementById("editor"),
  onSave: (layout) => {
    // Save layout JSON to your backend
    console.log("Saved:", layout);
  }
});

PDF Export (optional)

npm install jspdf
import { exportToPDF } from "qrlayout-core/pdf";

const pdf = await exportToPDF(layout, [data1, data2]);
pdf.save("badges.pdf");

πŸ’Ύ How It Works β€” Design, Save, Print

The layout JSON output from qrlayout-ui is your single source of truth. Store it in your database, load it back anytime, and pass it with real records to qrlayout-core to generate labels.

  User designs in qrlayout-ui
          β”‚
          β”‚  onSave(layout JSON)
          β–Ό
  Your database / backend       ← store the layout JSON like any other record
          β”‚
          β”‚  fetch layout + your real data (employees, machines, assets…)
          β–Ό
  qrlayout-core (StickerPrinter)  ← merges data into the template
          β”‚
          β”œβ”€β”€ exportToPNG()   β†’ download as image
          β”œβ”€β”€ exportToPDF()   β†’ printable PDF (batch)
          └── exportToZPL()   β†’ send to Zebra thermal printer
// 1. Save the layout from the designer
onSave: async (layout) => {
  await fetch("/api/layouts", { method: "POST", body: JSON.stringify(layout) });
}

// 2. Later β€” fetch the saved layout and your real data, then print
const layout  = await fetch("/api/layouts/employee-badge").then(r => r.json());
const records = await fetch("/api/employees").then(r => r.json());

const printer = new StickerPrinter();
const pdf = await printer.exportToPDF(layout, records);
pdf.save("badges.pdf");

Note

About the live demo apps β€” Each framework demo (React, Angular, Svelte, Vue) comes with pre-built sample layouts and demo records so you can explore every feature without any setup.

All data is stored only in your browser's localStorage β€” nothing is sent to any server. Clearing browser storage resets the demo to its defaults. Your layouts and data never leave your browser.


🎯 Use Cases

Industry Example
🏭 Manufacturing & Warehousing ZPL shipping labels for Zebra printers
🎟️ Events & Conferences Personalized attendee badge generation
πŸ₯ Healthcare Patient wristbands and asset tagging
πŸ“¦ Inventory & Retail SKU labels with QR codes linking to product pages
🏒 HR & Access Control Employee ID cards and visitor passes
πŸ”§ MRO / Maintenance Machine asset tags with scannable maintenance history links

πŸ— Project Structure

This monorepo is managed with npm workspaces:

qr-code-layout-generate-tool/
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ core/          # qrlayout-core β€” headless rendering engine
β”‚   └── ui/            # qrlayout-ui  β€” visual drag-and-drop designer
└── examples/
    β”œβ”€β”€ react-demo/    # React + Vite reference app
    β”œβ”€β”€ angular-demo/  # Angular 19 reference app
    β”œβ”€β”€ svelte-demo/   # Svelte 5 reference app
    └── vue-demo/      # Vue 3 reference app

πŸ“¦ Packages

Package Version Description Docs
qrlayout-core npm Headless rendering & logic engine API Reference
qrlayout-ui npm Interactive visual designer Integration Guide

πŸ›  Development

# Clone the repo
git clone https://github.com/shashi089/qr-code-layout-generate-tool.git
cd qr-code-layout-generate-tool

# Install all workspace dependencies
npm install

# Run the UI in dev mode (live preview)
npm run dev:ui

# Build all packages
npm run build:core
npm run build:ui

πŸ“š Documentation


🀝 Contributing

Contributions, bug reports, and feature requests are welcome!

  1. Fork the repository
  2. Create your feature branch: git checkout -b feature/my-feature
  3. Commit your changes: git commit -am 'Add my feature'
  4. Push to the branch: git push origin feature/my-feature
  5. Open a Pull Request

Found a bug or have an idea? Open an Issue β†’


πŸ‘€ Author

Shashidhar Naik


πŸ“„ License

MIT Β© Shashidhar Naik


If this project helped you, please give it a ⭐ on GitHub!
It helps more developers discover the tool.

About

Framework-agnostic QR code label & badge designer for React, Angular, Vue, Svelte & Node.js. Drag-and-drop layout designer with {{variable}} data binding. Batch export to PDF, PNG, or ZPL for Zebra thermal printers.

Topics

Resources

License

Stars

Watchers

Forks

Contributors