03 · watch · loaders

Page scanner Pro

A machined head floats over a sheet of real paper and its one cool line of light reads it: down slowly, back quickly. The print turns to ink behind the line, each value it recognises gets a lit underline and drops into a capsule, and it confirms when the scan is complete.

Install

bash
npx shadcn@latest add @mu-pro/page-scanner

Pro. Installs with a licence key through the @mu-pro registry. Checkout opens soon: until then Pro installs are closed, and nothing can be bought on this site.

Usage

tsx
import { PageScanner } from "@/components/mu/page-scanner/PageScanner";

<PageScanner
  fields={[
    { label: "Name", value: "Ada Moreau" },
    { label: "Date", value: "14 Nov 2026" },
    { label: "Total", value: "$1,284.00" },
  ]}
  onComplete={() => console.log("scanned")}
/>

How it works

Input and reduced motion

  • Screen readers: the caption's two lines are a polite live region (role="status"); they announce each page and the completion, not each field.
  • Reduced motion: the head stays parked at the top with its line lit, without the blade, the raking tooth or its cast shadow. The page shows each side read without turning (it switches at once) while the caption steps through the pages, then shows side one with every field found, and the lamp goes out. Capsules and the tick fade in without popping or drawing.

Props

PropDefaultWhat it does
fieldsthree demo fieldsup to three { label, value } found on side one, shown as capsules
pages21 or 2 sides; two-sided pages turn over between passes, and back to side one when done
secondsPerPage2.6one read pass down and one return pass up
runKey0a number or string; change it to scan again, and the old read fades and the head glides home from wherever it is. Changing pages, secondsPerPage or the number of fields also starts a new scan
onComplete—called once the scan is complete
labelsEnglish{ scanning, complete, page(n, of), found(pages, fields) }
soundoffsweep and chime for a scan a person started: true, or a volume 0–1 (see Sound)
className—added to the root

Sound

Off by default. With sound (or a volume, sound={0.5}) each read pass sweeps and completion chimes, but only for a scan a person started: a new runKey set from their press (the browser's user activation). The scan that plays on its own as it scrolls into view stays silent, and a sweep stops if the scanner leaves the view. setMuted(true) from components/mu/sounds.ts silences every cottoncandy item at once.

Licence

Included with Pro: use it in unlimited end products for you and your clients; no reselling as a kit. See the licence.