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 render Web Cube in your HTML.

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

You should also add styles to define the element size in your layout.

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

The cube automatically adjusts to the size of its container.

Next steps:

© 2026 Axford