Component packs › Aisle › Stock Meter
The stock stands on a wooden shelf; add one to the bag and it lifts off and arcs into the bag as the gap closes.
Stock Meter is a stock from Aisle, a component pack with 6 product page components: Product page controls where the product itself changes with every choice. Price: $2 for the whole pack.
Built with: shelf of items, arc into the bag, meter role.
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.
| Prop | Type | Default | Description |
|---|---|---|---|
stock | number | 5 | Items left. Default 5. |
capacity | number | 8 | Shelf capacity, up to 8. Default 8. |
low | number | 5 | "Only N left" at or below this. Default 5. |
glaze | number | Glaze, 0 to 4 (0 follows the pack colour). | |
onAdd | (left: number, inBag: number) => void | ||
autoplay | number | false | Showcase mode: adds one to the bag (and restocks when empty) every N ms while visible. |
readonly stock: numberrestock(n: number): voiddestroy(): voidimport StockMeter from './StockMeter';
<StockMeter />The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.
Good for: Skeuomorphic UI.