Lifetime prices rise on 19 October →
Phox Elements
PHYSICS Matter.js physics effects for Breakdance

Fill any section with falling, bouncing shapes

Matter JS drops circles or your own images into a section and lets real physics take over. They fall, stack, float or bounce, and visitors can grab and throw them with the mouse. The effect starts when the section scrolls into view.

Uses your own images Drag and throw with the mouse Stack, float or bounce
Live demos

Five physics effects, all three behaviours

Stack, Float and Bounce, plus Reverse Spawn and Manual Spawn. Each effect starts when half of its box is on screen. On a computer, click and drag the shapes to throw them. In the orchard demo, press Pick an apple.

Stack, with an obstacle

Confetti that lands on a sale headline

Behaviour: Stack. 140 plain circles, gravity 0.6, bounciness 0.5. The headline box has the class obstacle, so the circles pile up on top of it. Grab and throw them with the mouse.

Summer saleEverything 20% off until Sunday
Float

Slow drifting shapes for a wellness studio

Behaviour: Float. There is no gravity, so 40 circles from 12 to 42 pixels drift and nudge each other inside the box.

Breathe in. Breathe out.

Reverse Spawn

Bubbles rising in a lemonade advert

Behaviour: Stack with Reverse Spawn on. Gravity pulls upwards, so 90 small circles rise from the bottom and gather under the top edge.

Cloudy lemonade
Made with real lemons

Bounce

Balls that never stop, for a soft play centre

Behaviour: Bounce with Reverse Spawn, so 24 balls launch from the bottom. Every wall is solid and nothing loses energy, so they keep bouncing. Throw one and watch it go.

Manual Spawn, with images

Pick apples into an orchard crate

Manual Spawn is on and the button has the class spawnButton, so each click drops one apple image. The crate is an obstacle, so apples land on it and roll off.

Orchard crate
How it works

Three steps to a physics section

The element sets up the effect. The section you choose is where it plays.

1

Add a class

Give a section or div a class name, such as matter, in its Advanced settings.

2

Add the element

Drop Matter JS inside it and enter the same class name, without the dot.

3

Tune the physics

Add images if you want them, then set the number of items, sizes, gravity and behaviour.

Features

What you can control

Built on the Matter.js physics engine, loaded only on pages that use the element.

Your own images

Add logos, icons or any images and each item picks one at random. With no images, plain circles are used.

Three behaviours

Stack piles items on the floor. Float lets them drift with no gravity. Bounce keeps them bouncing off every wall.

Gravity and bounciness

Set how hard items fall and how much they bounce when they land.

Reverse spawn

Flip gravity so items rise from the bottom and gather at the top.

Drag and throw

Visitors can pick up items and throw them with the mouse. Turn it on for touch screens too if you want.

Manual spawn

Give any button the class spawnButton and each click drops one item, as in the orchard demo.

Size range

Set a minimum and maximum size and each item gets a random size between them.

Spawn rate

Control how quickly items appear, from 0 to 3.

Obstacles

Give an element inside the section the class obstacle and items will land on it and roll off it.

Starts in view

The effect waits until half the section is visible, so visitors see it from the start.

Contained in the section

Items stay inside the section's walls and the canvas resizes with the window.

Many items

Set the number of items to drop. The confetti demo above uses 140.

Use cases

Where it works best

Anywhere a bit of play makes a visitor stop and look.

01

Hero sections

Drop your logo or product icons into the first screen of a landing page.

02

Client and partner logos

Let a pile of logos fall into place instead of a static grid.

03

Campaign pages

Use themed images, like apples, sweets or snowflakes, for a seasonal page.

04

Game-like buttons

Use manual spawn so each click of a button adds another item.

05

Footer sign-offs

End a page with something visitors want to play with.

06

Agency portfolios

Show off interactive work with a section people can touch.

Settings reference

Every control, explained

This is the full list of settings in the Breakdance editor, with their default values.

ControlWhat it doesDefault
Content
Section Class NameClass of the section or div where the effect plays, without the dot.matter
ImagesRepeater of images used for the items. Leave empty for plain circles.—
Number of ItemsHow many items drop in total.50
GravityHow strongly items are pulled down, or up with Reverse Spawn.0.3
BouncinessHow much items bounce in Stack mode.0.8
BehaviourStack, Float or Bounce.Stack
Min SizeSmallest item radius.5
Max SizeLargest item radius.25
Spawn RateDelay factor between items, 0 to 3.0.5
InteractiveLet visitors drag and throw items with the mouse.On
Interactive on MobileAlso allow dragging on touch devices.Off
Reverse SpawnItems start at the bottom and rise.Off
Manual SpawnDrop one item per click of a button with the class spawnButton.Off
Tips & FAQ

Good to know

Where does the effect appear?

In every section or div that has the class you enter in Section Class Name. Add the class in that element's Advanced settings.

Why is nothing happening?

Check that the class name matches exactly and is entered without the dot. The section also needs a height, and the effect only starts once half of it is on screen.

Can I use my logo instead of circles?

Yes. Add one or more images in the Images repeater. Transparent PNGs look best.

Does dragging work on phones?

Only if you turn on Interactive on Mobile. It is off by default so the section does not get in the way of scrolling.

How do I make a button drop items?

Turn on Manual Spawn and give your button the class spawnButton. Each click drops one item until the Number of Items is reached.

Can items land on text or other elements?

Yes. Give an element inside the section the class obstacle and it becomes a solid shape the items collide with.

Add Matter JS to your next page

Matter JS is included with Phox Elements, along with 140+ other premium elements for Breakdance.