Getters

The WebCube class exposes read-only getters for runtime inspection.

size

Returns the current cube size as a number.

  • Type: number

isRotating

Returns whether a rotation animation is currently running.

  • Type: boolean

Example

index.ts
import { WebCube } from "@web-cube/web-cube";
const cube = document.querySelector("web-cube") as WebCube;
console.log("Size:", cube.size);
if (!cube.isRotating) {
await cube.rotateCube({ axis: "y", angle: 90 });
}

You can combine these getters with events from Events.

© 2026 Axford