reactbits.dev
Get started

Balls! What's not to like about them?

React Bits brings motion and character to your interface, one copy-paste component at a time.

Start buildingBrowse components
9:41

Balls! What's not to like about them?

React Bits brings motion and character to your interface, one copy-paste component at a time.

Start buildingBrowse components

Balls! What's not to like about them?

React Bits brings motion and character to your interface, one copy-paste component at a time.

Get startedLearn more
Colors
Count
200
Min Size
0.5
Max Size
Gravity
0
Friction
0.9975
Wall Bounce
0.95
Bounce
0.85
Depth
2
Drift
0.4
Cursor Size
Light Intensity
Exposure
Shadows
0.6

More backgrounds in Pro

Shader scenes and animated surfaces made to sit behind real content.

View all 106
23 properties
count200Number of balls in the pit.
colorsArray<string | number>['#ffffff']Ball colors, handed out in turn. Hex strings or numbers such as 0x5227ff.
material'satin' | 'matte' | 'gloss' | 'frosted' | 'metal''satin'Surface finish: soft satin, chalky matte, polished gloss, see-through frosted or brushed metal.
minSize0.5Smallest ball radius. The view is about 18 units tall.
maxSizeLargest ball radius.
gravity0.5Pull toward the floor. 0 lets the balls float, around 0.5 piles them up.
friction0.9975How much speed the balls keep each frame. 1 never slows them down.
wallBounce0.95How much speed the balls keep when they hit the edges, from 0 to 1.
bounce0.85How bouncy the balls are against each other, from 0 to 1.
depth2How deep the pit is, so balls can sit in front of and behind each other.
driftGentle wandering that keeps floating balls moving on their own.
followCursorA ball follows the cursor and shoves the others out of the way.
cursorSizeRadius of the cursor ball.
grabPress on a ball to pick it up, drag it around and throw it.
clickEffect'burst' | 'none''burst'Clicking an empty spot blasts the nearby balls away with a flash of light.
lightColor'#ffffff'Color of the light that follows the cursor and lights up the balls around it.
lightIntensityBrightness of the cursor light.
exposureOverall brightness of the balls.
shadows0.6Strength of the soft shadows where balls touch each other and the floor.
Balls pour in from the top on mount, or burst out from the center when gravity is near zero.
dprautoMaximum device pixel ratio, capped at 2.
Extra class names for the container.
Inline styles for the container.
countnumber

Number of balls in the pit.

Default200
colorsArray<string | number>

Ball colors, handed out in turn. Hex strings or numbers such as 0x5227ff.

Default['#ffffff']
material'satin' | 'matte' | 'gloss' | 'frosted' | 'metal'

Surface finish: soft satin, chalky matte, polished gloss, see-through frosted or brushed metal.

Default'satin'
minSizenumber

Smallest ball radius. The view is about 18 units tall.

Default0.5
maxSizenumber

Largest ball radius.

gravitynumber

Pull toward the floor. 0 lets the balls float, around 0.5 piles them up.

Default0.5
frictionnumber

How much speed the balls keep each frame. 1 never slows them down.

Default0.9975
wallBouncenumber

How much speed the balls keep when they hit the edges, from 0 to 1.

Default0.95
bouncenumber

How bouncy the balls are against each other, from 0 to 1.

Default0.85
depthnumber

How deep the pit is, so balls can sit in front of and behind each other.

Default2
driftnumber

Gentle wandering that keeps floating balls moving on their own.

followCursorboolean

A ball follows the cursor and shoves the others out of the way.

cursorSizenumber

Radius of the cursor ball.

grabboolean

Press on a ball to pick it up, drag it around and throw it.

clickEffect'burst' | 'none'

Clicking an empty spot blasts the nearby balls away with a flash of light.

Default'burst'
lightColorstring

Color of the light that follows the cursor and lights up the balls around it.

Default'#ffffff'
lightIntensitynumber

Brightness of the cursor light.

exposurenumber

Overall brightness of the balls.

shadowsnumber

Strength of the soft shadows where balls touch each other and the floor.

Default0.6
introboolean

Balls pour in from the top on mount, or burst out from the center when gravity is near zero.

dprnumber

Maximum device pixel ratio, capped at 2.

Defaultauto

Extra class names for the container.

Inline styles for the container.