ONONC

Ballpit

A pit of colorful balls under gravity that scatter away from the cursor.

canvasphysicsinteractive

Styled with ONONC's design tokens shadcn add installs them for you.

Customize

Balls

Balls40
Ball size18px

Physics

Gravity1
Bounce0.75
Cursor force1

Appearance

Color 1
Color 2
Color 3
Gloss0.7

Props

PropTypeDefaultDescription
countnumber40Number of balls (capped at 80).
gravitynumber1Downward gravity strength (0 = weightless).
bouncenumber0.75Bounciness of walls + collisions (0 = dead, 1 = elastic).
sizenumber18Base ball radius in px.
pointerForcenumber1How hard the cursor shoves nearby balls.
colorsstring[]brand spectrumBall colors as r,g,b.
glossnumber0.7Glossy top-lit shading strength (0–1).
childrenReactNodeContent layered above the canvas.
classNamestringExtra classes for the wrapper.