Component packs › Baize › Ball Counter
Each added ball rolls down the return rail and knocks into the line; each removed one is lifted out.
Ball Counter is a stepper from Baize, a component pack with 6 billiards components: Controls played on a pool table: balls that roll, knock, bank off cushions and drop into pockets. Price: $2 for the whole pack.
Built with: 1D knock chain, slope and stop, thin tabular count.
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 |
|---|---|---|---|
value | number | ||
min | number | ||
max | number | At most 15 (a full rack). | |
label | string | What is counted, e.g. "Players". | |
width | number | 360 | Width in px. Default 360. |
dark | boolean | ||
onChange | (value: number) => void | ||
autoplay | number | false | Showcase mode: steps up and down every N ms while visible. |
value: numberdestroy(): voidimport BallCounter from './BallCounter';
<BallCounter />The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.
Good for: Skeuomorphic UI.