POS & Billing Build

Stage 01 · Interface

Home › Apps › POS & Billing › Stage 01
🧾 Stage 01 · 2 hours

Build the counter.
Grid. Cart. Charge.

The static shell of a POS app. A product grid on the left, a cart on the right, totals at the bottom, a big Charge button, and an 80mm thermal receipt modal. No data, no logic, no JavaScript beyond a demo focus ring. Just the layout that Stage 02 will bring to life.

2 hours Beginner HTML · CSS
POS hub The layout Why POS is different The four parts The receipt Full file Next: Stage 02

Short answer: A two-column CSS grid. Left: a scrollable product grid with category chips and a product count. Right: a fixed-width cart panel with line items (name, qty ±, unit price, line total, remove), a totals block (subtotal, editable tax rate, tax amount, grand total), and a Charge button whose label includes the amount. A top bar with a barcode input that's always focused. A receipt modal styled as 80mm thermal paper. That's Stage 01 — the shell, built to be filled.

✅ The layout

Two columns. One job.

Top bar (56px)

Brand mark, register name, barcode input (flexes to fill space, max 480px), cashier chip, history button. One row. No navigation.

Catalog (left, flexes)

Category chips at the top, product count on the right, then an auto-fill grid of product cards. Scrolls independently. Min card width 160px, so a 900px screen shows 4–5 cards per row.

Cart (right, 400px)

Fixed width. Header with item count. Scrollable lines. Totals block pinned to the bottom. Action bar below the totals.

Nothing else

No sidebar. No footer. No floating action button. The screen is the app. Every pixel is either a product, a cart line, or an action.

shell.css
.pos-shell {
  display: grid;
  grid-template-rows: var(--topbar-height) 1fr;
  grid-template-columns: 1fr var(--cart-width);
  grid-template-areas:
    "topbar topbar"
    "catalog cart";
  height: 100vh;
}

.pos-topbar  { grid-area: topbar;  }
.pos-catalog { grid-area: catalog; overflow-y: auto; }
.pos-cart    { grid-area: cart;    display: flex; flex-direction: column; min-height: 0; }

/* Cart is a flex column: header (fixed), lines (flex + scroll),
   totals (fixed), actions (fixed). Only the lines scroll. */
.pos-cart-header { flex-shrink: 0; }
.pos-cart-lines  { flex: 1; overflow-y: auto; min-height: 0; }
.pos-totals      { flex-shrink: 0; }
.pos-actions     { flex-shrink: 0; }

Why autocomplete="off": browsers love to autofill. A POS barcode field that autofills a previous value is a disaster — the cashier scans an item and gets a stale barcode. Explicit off on this field is non-negotiable.

Why autofocus: so the first scan after page load lands correctly. In Stage 02, we add explicit re-focus after every action — autofocus only fires once.

Why the wrapper has .is-focused: the input itself is transparent inside a styled label. The focus ring belongs to the label, not the input. A tiny focus/blur listener toggles the class. This is a Stage 01 convenience — Stage 02 uses the focus state to decide whether a keystroke should go to the barcode buffer or to a search field.

✅ The receipt — a paper metaphor

White. Monospace. Print-ready.

The receipt modal is not a dark-theme card with a white background. It's a paper metaphor — monospace font on white, dashed rules, a heavy top border above the grand total, and a centered footer. It looks like what it will print.

receipt.css
.pos-receipt {
  padding: 1.5rem;
  background: white;
  color: #000;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.75rem;
  line-height: 1.4;
  margin: 1rem;
  border-radius: 4px;
}

.pos-receipt-hr {
  border: none;
  border-top: 1px dashed #999;
  margin: 0.75rem 0;
}

.pos-receipt-line {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.pos-receipt-line span:last-child {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.pos-receipt-line.is-grand {
  font-size: 0.9375rem;
  font-weight: 800;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #000;
}

Why monospace: thermal printers use fixed-width fonts. A proportional font on screen would show a receipt the printer can't reproduce. The on-screen receipt is a preview, not a decoration.

Why font-variant-numeric: tabular-nums: even within monospace, prices should align column-perfect. tabular-nums forces digits to equal widths so $9.99 and $89.00 line up on the decimal. This applies everywhere prices appear — cart lines, totals, receipt.

Why the margin: 1rem: the receipt is a card inside the modal, not the modal itself. The margin creates a paper-inside-a-frame look. In Stage 04, @media print removes the margin so the receipt fills the printed page at 80mm width.

✅ The full file

One HTML file, ready to open.

The complete file is at /apps/pos/downloads/pos-stage-01.html. It's the same file the earlier sections described, fully assembled. Open it in a browser — the barcode input takes focus on load, pressing Enter opens the receipt modal, everything else is static.

Download:
Download pos-stage-01.html →

Right-click, save link as. Or open in a new tab and use File → Save Page.

Look at it

Open the file. Notice the cart is populated — this is intentional. An empty cart lies about the layout. The empty state is behind the Remove buttons.

Click around

Press Enter in the barcode field. The receipt modal opens. Close it with × or by clicking outside. Notice the receipt looks like paper, not a dark card.

Resize it

Narrow the window to under 900px. The cart drops below the catalog and caps at 50vh. Under 600px, the register label and cashier name hide. No broken layout.

Break it (intentionally)

Tab away from the barcode field. The focus ring goes away. Press Enter — nothing happens. This is the failure mode Stage 02 fixes: focus is always restored.

➡️ Next: Stage 02 — Interactions

The shell comes alive.

Stage 02 makes the cart real. Tap a product → it's added. Adjust qty → line total and grand total update. Remove → the line goes away. Charge → a payment modal with cash tendered and change due. Complete sale → the cart clears, a receipt prints, the cart persists in localStorage across reloads.

The hard problems in Stage 02:

That's Stage 02. Ready when you are.

🔗 Continue the build

⚡ Next: Stage 02 — Interactions
Client-side cart with live totals, localStorage persistence, payment modal, receipt preview. 3–4 hours.
🧾 Back to the POS hub
All four stages in one place, with the roadmap and the data model.
← Back to POS & Billing hub
POS Stage 01 · Interface