Plinko board
A pegboard that turns chance into a shape. Each ball falls through the rows, bouncing left or right at every peg, and lands in a bin; as more balls land, the bins build into a bell curve.
When to use
- Explaining probability and averages.
- A playful result screen where chance is the point.
When not to use
- Anything that must be fair to a user, like a prize draw; use a server-side draw.
- Thousands of balls.
Installation
pnpm dlx shadcn@latest add @caliper/plinko-board
Adds its 2 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
API reference
PlinkoBoard
3 props
Also accepts the native props of its root element and a ref.
binCount
0 props
No props of its own; it accepts the native props of its root element.
lane
0 props
No props of its own; it accepts the native props of its root element.
Keyboard
- No custom key handling; Tab and the native activation keys do the work.
Accessibility
It exposes img semantics, with aria-label and aria-hidden kept in step with state.
Motion
- State changes animate with the library's shared durations and curves, so its timing matches every other part.
- Under reduced motion each change lands on its end state without movement; nothing is hidden or skipped.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/plinko-board.mdThe index of every part is at /llms.txt.