Skip to main content

model

The model component renders GLTF and GLB models using Three.js.

Usage

Modular:

import { model } from "/42/ui/media/model.js"

const myModel = model({
src: "/models/object.glb",
interactive: true,
visualization: "both",
})

Plan:

{
tag: "ui-model",
src: "/models/object.glb",
interactive: true,
visualization: "both",
}

Properties

PropertyTypeDescription
srcStringURL to the 3D model file
interactiveBooleanIf true, enables controls (orbit, pan, zoom)
visualization"both" | "solid"Toggles wireframe