Set Up

Register the custom element

You can register the custom element using the define function from the @web-cube/web-cube package.

index.ts
import { define } from "@web-cube/web-cube";
define();

Using a custom tag name

You can use a custom tag name to define the custom element.

By default, the custom element is defined with the tag name web-cube.

index.ts
import { define } from "@web-cube/web-cube";
define("custom-cube");

Embed in your page

Once the custom element is defined, you can easily embed Web Cube in your existing project or start a new project using the following code.

index.html
<web-cube></web-cube>

Also is possible to you must add some styles to the custom element to adjust the size and position.

index.css
web-cube {
display: block;
width: 100%;
height: 100%;
}

The cube will automatically adjust to the size of container.

© 2025 Axford