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 (default false) Set true to flip pointer drag direction.
interactive boolean (default false) Attach pointer handlers so users can drag the camera.

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 (default 16) Grid height. Used for CSS grid template rows.
cols number (default 16) Grid width. Used for CSS grid template columns.
depth number | inferred Number of layers. Inferred from the highest voxel.z (fallback 12).
showWalls boolean (default false) Toggles the floor-to-ceiling wall container.
showFloor boolean (default false) Toggles the floor grid background.