Photon Cube
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.
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.
| Prop | Type | Default | Description |
|---|---|---|---|
children | React.ReactNode | — | The page drawn over the scene. The scene fills the box it makes, so give it a height, usually the screen's. |
placement | PhotonCubePlacement | "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. |
pulseEvery | number | 3 | About how many seconds pass between the pulses of light the cube sends round its edges by itself. 0 leaves them to clicks. |
interactive | boolean | true | Whether 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. |
cool | string | "#aac8ff" | The light's colour on most of the edges. |
warm | string | "#ff9955" | The colour the light turns on the cube's lower left. |
speed | number | 1 | How fast the light runs round the edges, as a multiple of its own pace. |
glow | number | 1 | How strongly the light blooms. 0 leaves the bare strands. |
reflection | boolean | true | Whether the floor holds the cube's reflection. Off, the ground is plain black and the scene draws less. |
className | string | — | Class for the outer element, which the scene fills. |
style | React.CSSProperties | — | Styles for the outer element, applied after its own, so a height or `position: absolute` set here wins. |