Photon Cube

ProBackgrounds3DWebGLpowered by @vectorvesper/motion

A cube of light strands floating over a black polished floor. Pulses of light run round its edges and loose strands trail off its corners, and the floor holds its reflection. The view leans with the pointer, and a click sends light from the nearest corner.

Photon Cube

Included with membership

Members install Photon Cube with one command and get the full source, the usage code and the Framer remix, licensed for client work. One membership covers the whole library and the CLI.

When to use it

A hero or a launch page that wants one striking object on a plain black ground. Put your headline beside it with placement="left" or "right".

  • Give it a height, usually the screen's, with style or className.
  • Use placement to leave room for a headline. On a narrow screen the cube stands in the middle.

Avoid:

  • Do not put two on one page. Each draws a full scene with bloom.

Props

A cube of light strands floating over a black polished floor. Pulses of light run round its edges and loose strands trail off its corners, and the floor holds its reflection. The view leans with the pointer, and a click sends light from the nearest corner.

<PhotonCube />

A cube of light strands floating over a black polished floor.

PropTypeDefaultDescription
childrenReact.ReactNode—The page drawn over the scene. The scene fills the box it makes, so give it a height, usually the screen's.
placementPhotonCubePlacement"center"Where the cube stands across the width: in the middle, or to one side to leave room for a headline. On a narrow screen it stands in the middle.
pulseEverynumber3About how many seconds pass between the pulses of light the cube sends round its edges by itself. 0 leaves them to clicks.
interactivebooleantrueWhether the view leans with the pointer, and a click sends light from the cube's nearest corner. Clicks on links, buttons and fields are left alone.
coolstring"#aac8ff"The light's colour on most of the edges.
warmstring"#ff9955"The colour the light turns on the cube's lower left.
speednumber1How fast the light runs round the edges, as a multiple of its own pace.
glownumber1How strongly the light blooms. 0 leaves the bare strands.
reflectionbooleantrueWhether the floor holds the cube's reflection. Off, the ground is plain black and the scene draws less.
classNamestring—Class for the outer element, which the scene fills.
styleReact.CSSProperties—Styles for the outer element, applied after its own, so a height or `position: absolute` set here wins.
Visitors who prefer reduced motion get a still in place of the moving scene. Devices below the runtime's floor get the same.
It runs on the shared frame loop, and the runtime lowers the resolution when frames run long. It stops drawing while it is off screen.
Client component. The server renders the box and anything inside it, and the scene is built in the browser.
Back to all components