App UI kits › Portion › Barcode

Barcode

A real EAN-13 is read bar by bar as the scan line passes; the frame closes with a tick and the label sheet rises with servings that roll.

Barcode is a screen from Portion, an app ui kit with 11 screens: A calorie tracker where you resize the food on your real plate. Price: $5 for the whole pack.

Built with: EAN-13 encoder, bar-by-bar read, not found path.

Code: React and Next.js (TypeScript), Vue 3, plain HTML/CSS/JS, Tailwind CSS v4 and Motion (motion.dev). No npm packages needed. Keyboard accessible, with a reduced-motion version, in dark and light.

Barcode props

PropTypeDefaultDescription
darkboolean
autoplayboolean
photosPvPhotos
codestringThe 12 first digits of the code to show; the check digit is computed.
onAdd(food: string, grams: number) => void

Methods on the ref

Use it in React

import PortionScan from './PortionScan';

<PortionScan />

The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.

More in Portion

Good for: Calorie tracker app UI.