@drawcall/uikitml in the browser.public/ui/menu.uikitml
↓ fetch and parse
UIKit component tree
↓ wrap
UIKitMLAsset + UIKitDocument
↓ place
World transform, ScreenSpace, or Follower
const assets = {
menu: {
type: AssetType.UIKitML,
url: '/ui/menu.uikitml',
},
} satisfies AssetManifest;
const world = await World.create(container, {
assets,
features: { spatialUI: true },
});
const menu = await world.assets.instantiate<UIKitMLAsset>('menu');
const entity = world.createTransformEntity(menu);
Lucide icons through the default component sets. Names are case-sensitive, and unsupported tags or properties produce parser errors.<Panel class="menu">
<h1>Settings</h1>
<button id="save-button">
<ButtonIcon><Settings /></ButtonIcon>
Save
</button>
</Panel>
| Need | Mechanism |
|---|---|
Panel belongs to a place or object | Authored world transform or object parent |
Browser viewport overlay | ScreenSpace |
Compact in-XR UI that follows after a threshold | Follower |
Tiny transient marker with exact view alignment | Parent to world.playerHeadEntity |
const menu = world.requireSceneObject<UIKitMLAsset>('settings-panel');
const saveButton = menu.requireElementById('save-button');
saveButton.addEventListener('click', saveSettings);
RayInteractable for browser-pointer and
XR-ray events, PokeInteractable for touch events, or both. These interaction
tags are required for IWSDK’s pointer stack to dispatch the corresponding UI
events.