API Reference

VoxCSS ships a headless renderer plus thin Vue/React/Svelte wrappers. Use this page as the single source of truth for props, context options, textures and release mechanics while the docs site evolves.

VoxCamera (Vue / React / Svelte)

Wrap every scene in a VoxCamera to mount the CSS 3D box. Pointer controls are opt-in—pass interactive when you want to expose camera dragging.

Prop Type Description
zoom number (default 0.65) Scales the scene container.
pan number (default 0) Horizontal translation of the camera.
tilt number (default 0) Vertical translation additive to depth offset.
rotX number (default 65) Rotation around the X axis in degrees.
rotY number (default 45) Rotation around the Y axis in degrees.
perspective number | false (default 8000) CSS perspective applied to the scene container. Pass false to remove it.
invert boolean | number (default false) Flip pointer drag direction (or pass -1 / 1).
interactive boolean (default false) Attach pointer handlers so users can drag the camera.
animate boolean | number | object Auto-rotate the camera. Accepts true, a speed number, or { axis, speed, pauseOnInteraction }.

VoxScene props

The VoxScene component consumes your voxel grid and synchronises dimensions with the camera controller.

Prop Type / default Description
voxels VoxelGrid (default empty array) Flat array of voxels. Replacing the array triggers a re-render.
rows number (optional) Grid height override; otherwise inferred from voxels.
cols number (optional) Grid width override; otherwise inferred from voxels.
depth number (optional) Layer count override; otherwise inferred from voxels.
showWalls boolean (default false) Toggles the floor-to-ceiling wall container.
showFloor boolean (default false) Toggles the floor grid background.
projection "cubic" | "dimetric" (default "cubic") Switch layer spacing and wall mask to a dimetric view.