# HTML

> Allows you put DOM elements in your Tres.js scene.

This component allows you to project HTML content to any object in your scene. TresJS will automatically update the position of the HTML content to match the position of the object in the scene.

🚀 Works seamlessly with both **PerspectiveCamera** and **OrthographicCamera** — the active camera is automatically detected by the `<Html>` component.

<scene-wrapper>
<objects-html>



</objects-html>
</scene-wrapper>

## Usage

```vue
<script setup lang="ts">
import { Html, OrbitControls } from '@tresjs/cientos'
import { TresCanvas } from '@tresjs/core'
</script>

<template>
  <TresCanvas clear-color="#82DBC5">
    <TresPerspectiveCamera :position="[2, 2, 5]" />
    <OrbitControls />
    <TresMesh :position="[1, 1, 1]">
      <TresBoxGeometry />
      <TresMeshNormalMaterial />
      <Html
        center
        transform
        :distance-factor="4"
        :position="[0, 0, 0.65]"
        :scale="[0.75, 0.75, 0.75]"
      >
        <h1 class="title">I'm a Box 📦</h1>
      </Html>
    </TresMesh>
    <TresGridHelper />
    <TresAmbientLight />
  </TresCanvas>
</template>
<style scoped>
.title {
  background-color: #1e1e1e;
  color: #ffffff;
  font-size: 0.75rem;
  padding: 0.25rem;
  border-radius: 0.375rem;
}
</style>
```

## Occlusion

By default, the HTML content will be visible through other objects in the scene. You can use the `occlude` prop to make the HTML content occlude other objects in the scene.

Html can be hidden behind one or more objects in your scene using the `occlude` prop.

```vue
<Html occlude>
```

If `occlude`, then `<Html>` will be hidden by any objects that pass in front of its position.

<scene-wrapper>
<objects-html-occlusion>



</objects-html-occlusion>
</scene-wrapper>

<details>
<summary>

Demo code

</summary>

```html
<TresMesh :position="[0, 1, -2]">
  <TresBoxGeometry />
  <TresMeshNormalMaterial />
  <html center transform occlude :distance-factor="4" :position="[0, 0, 2]" :z-index-range="[28, 0]">
    <h1 class="bg-white dark:bg-dark text-xs p-1 rounded">Move camera</h1>
  </html>
</TresMesh>
```

</details>

You can also choose which object or objects should occlude the HTML content by passing either a single object ref or an array of object refs to the `occlude` prop:

### Single occluder

```vue
<Html occlude="[mesh]">
```

<scene-wrapper>
<objects-html-single-occluder>



</objects-html-single-occluder>
</scene-wrapper>

<details>
<summary>

Demo code

</summary>

```html
<TresMesh :position="[0, 1, 0]">
  <TresBoxGeometry />
  <TresMeshNormalMaterial />
  <html center transform :occlude="[sphereRef]" :distance-factor="4" :z-index-range="[28, 0]">
    <h1 class="bg-white dark:bg-dark text-xs p-1 rounded">Move camera</h1>
  </html>
</TresMesh>
```

</details>

### Multiple occluders

```vue
<Html occlude="[mesh1, mesh2, mesh3, ...]" />
```

OR

```vue
<Html occlude="meshesArray" />
```

In the demo below, a `v-for` loop generates multiple spheres around the cube.
All resulting **Mesh** instances are collected into an array and passed to the **occlude** prop, allowing each sphere to occlude the HTML content.

This demo also uses the **on-occlude** event, which is triggered whenever the occlusion state changes.
Here, the event updates a **reactive value** to control element styles — for example, toggling between *light* and *dark* themes.

<scene-wrapper>
<objects-html-occlude-complex-demo>



</objects-html-occlude-complex-demo>
</scene-wrapper>

<details>
<summary>

Demo code

</summary>

```html
<TresMesh :position="[0, 1, 0]">
  <TresBoxGeometry />
  <TresMeshNormalMaterial />
  <html
    v-bind="htmlProps"
    :occlude="occluderRefs"
    :distance-factor="4"
    :z-index-range="[28, 0]"
    @on-occlude="(event: boolean) => isOccluded = event"
  >
    <h1 class="bg-white dark:bg-dark text-xs p-1 rounded">Move camera</h1>
  </html>
</TresMesh>
```

</details>

### Blending Occlusion

`<Html>` can hide behind geometry as if it was part of the 3D scene using this mode. It can be enabled by using "blending" as the occlude prop.

```vue
<Html occlude="blending">
```

The **demo below ⬇️** *(left black example)* shows a **basic usage example**.

<scene-wrapper>
<objects-html-occlude-blending-demo>



</objects-html-occlude-blending-demo>
</scene-wrapper>

<details>
<summary>

Demo code

</summary>

```vue
<script setup lang="ts">
import { Html, Levioso, OrbitControls } from '@tresjs/cientos'
import { TresCanvas } from '@tresjs/core'
import { shallowRef } from 'vue'
import { CircleGeometry, MeshStandardMaterial } from 'three'

const gl = {
  clearColor: '#82DBC5',
  clearAlpha: 1,
  shadows: true,
  alpha: true,
}

const targetDirectionLightRef = shallowRef(null)

const geometries = [
  {
    component: 'TresBoxGeometry',
    args: [1, 1, 1],
  },
  {
    component: 'TresSphereGeometry',
    args: [0.7, 32, 32],
  },
  {
    component: 'TresTorusGeometry',
    args: [0.5, 0.2, 16, 100],
    bind: { castShadow: true, receiveShadow: true },
  },
]

const customGeometry = shallowRef(new CircleGeometry(1.25, 32))

const customMaterial = shallowRef(new MeshStandardMaterial({
  color: 'red',
  side: 2,
  opacity: 1,
  transparent: true,
}))
</script>

<template>
  <div class="html-demo-wrapper aspect-video">
    <TresCanvas v-bind="gl">
      <TresPerspectiveCamera :position="[0, 1.5, 7.5]" />
      <OrbitControls />

      <Levioso
        v-for="(geometry, index) in geometries"
        :key="`html-occlude-blending-demo-${index}`"
        :speed="3"
        :float-factor="3.5"
        :rotation-factor="1"
        :range="[-0.35, 0.35]"
      >
        <TresMesh :position="[index * 3.5 - 3.5, 1, 0]" v-bind="geometry.bind">
          <component :is="geometry.component" :args="geometry.args" />
          <TresMeshNormalMaterial />
        </TresMesh>
      </Levioso>

      <Html
        center
        transform
        occlude="blending"
        :position="[-4, .75, -2]"
        :z-index-range="[28, 0]"
      >
        <div class="text-center text-s p-2 bg-[#1B1C1E] text-light">
          BASIC 💛 <br />
          <em>occlude=blending</em>
        </div>
      </Html>

      <Html
        center
        transform
        occlude="blending"
        :position="[0, .85, -2]"
        :geometry="customGeometry"
        :z-index-range="[28, 0]"
      >
        <div class="text-xs p-8 text-center bg-[#F6B03B] text-dark">
          CUSTOM <br /> <strong>CIRCLE <br /> GEOMETRY</strong>
        </div>
      </Html>

      <Html
        ref="targetDirectionLightRef"
        center
        transform
        occlude="blending"
        :position="[4, .5, -2]"
        :material="customMaterial"
        receive-shadow
        :z-index-range="[28, 0]"
      >
        <div style="width: 100px; height: auto; aspect-ratio: 250/250;"></div>
      </Html>

      <Html
        center
        transform
        occlude="blending"
        :position="[4, 2.5, -2]"
        :z-index-range="[28, 0]"
      >
        <div class="text-center text-xs p-2 text-dark bg-[#FF0000]">
          <strong>HTML + Custom material </strong> <br />
          <em>+ receive-shadow </em> ⬇️
        </div>
      </Html>

      <TresDirectionalLight
        v-if="targetDirectionLightRef?.instance"
        :target="targetDirectionLightRef?.instance"
        :shadow-normalBias="0.075"
        :position="[5, 0, 5]"
        :intensity="2"
        cast-shadow
      />

      <TresGridHelper :position-y="-1" />
      <TresAmbientLight :intensity="1" />
    </TresCanvas>
  </div>
</template>

<style scoped>
.html-demo-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background-color: #82dbc5;
}
</style>
```

</details>

## Custom Geometry

By default, when using `occlude="blending"`, occlusion works correctly only with **rectangular HTML elements** (using a `PlaneGeometry`).
For *non-rectangular content*, you can use the **geometry** prop to provide a matching custom geometry.

In the **demo above ⬆️** *(middle yellow example)*, a [`CircleGeometry`](https://threejs.org/docs/#api/en/geometries/CircleGeometry) is used as a **custom geometry**.

<prose-list>

- The `geometry` prop only defines the **occlusion shape** in 3D and does not modify your HTML content.
- You can provide any [`BufferGeometry`](https://threejs.org/docs/#api/en/core/BufferGeometry), for example to simulate **CSS-like styles** such as `border-radius` using a rounded rectangle or squircle geometry (see [`RoundedRectangle / Squircle geometry`](https://discourse.threejs.org/t/roundedrectangle-squircle/28645) for example).

</prose-list>

### Custom Material

You can also assign material properties to the HTML content using the `material` prop.
In the **demo above ⬆️** *(right red example)*, a **custom material** is used with shadow.

<prose-note>

The `material` prop is only available when `occlude="blending"` is **enabled**.

</prose-note>

<prose-note>

Enable shadows using the **castShadow** and **receiveShadow** props.
Shadows are supported **only** when using a **custom material**. By default, shadows do **not** work with *MeshBasicMaterial* or *ShaderMaterial*. <br />
</prose-note>

## Using `<Transition>`

The native Vue [`<Transition>`](https://vuejs.org/guide/built-ins/transition) component works seamlessly with `<Html>`.
This means you can **animate** how your projected HTML content *enters* and *leaves* the scene, exactly as you would in a regular Vue application.

<prose-note>

All **standard interactions** are supported just like on a regular HTML element — **hover effects**, **events**, and *any kind of DOM interaction* are fully possible.

</prose-note>

<scene-controls-wrapper>
<objects-html-transition-demo>



</objects-html-transition-demo>
</scene-controls-wrapper>

<details>
<summary>

Demo code

</summary>

```vue
<script setup lang="ts">
import { Html, Levioso, OrbitControls } from '@tresjs/cientos'
import { TresCanvas } from '@tresjs/core'
import { ref } from 'vue'

const gl = {
  clearColor: '#82DBC5',
  clearAlpha: 0,
  shadows: true,
  alpha: true,
  antialias: true,
}

const rootRef = ref<HTMLElement>()

const bgColor = ref('#F6B03B')

const geometries = [
  {
    component: 'TresBoxGeometry',
    args: [1, 1, 1],
  },
  {
    component: 'TresSphereGeometry',
    args: [0.7, 32, 32],
  },
  {
    component: 'TresTorusGeometry',
    args: [0.5, 0.2, 16, 100],
  },
  {
    component: 'TresConeGeometry',
    args: [0.7, 1.4, 32],
  },
]

const getRandomBackgroundColor = (): string => {
  const colors = ['#F6B03B', '#82DBC5', '#FF5733', '#33FF57', '#3357FF', '#F333FF', '#33FFF5']
  const idx = Math.floor(Math.random() * colors.length)
  return colors[idx] ?? '#F6B03B'
}

const updateBackgroundColor = () => {
  bgColor.value = getRandomBackgroundColor()
}
</script>

<template>
  <div ref="rootRef" class="html-demo-wrapper">
    <TresCanvas v-bind="gl" class="!pointer-events-none">
      <TresPerspectiveCamera :position="[0, 1.5, 7.5]" />
      <OrbitControls :dom-element="rootRef" />

      <Levioso
        v-for="(geometry, index) in geometries"
        :key="`html-occlude-blending-demo-${index}`"
        :speed="3"
        :float-factor="3.5"
        :rotation-factor="1"
        :range="[-0.4, 0.4]"
      >
        <TresMesh :position="[(index - (geometries.length - 1) / 2) * 2, 1, 0]">
          <component :is="geometry.component" :args="geometry.args" />
          <TresMeshNormalMaterial />
        </TresMesh>
      </Levioso>

      <Html
        center
        transform
        occlude="blending"
        :position="[0, .75, -2]"
        :scale="1.15"
        :z-index-range="[28, 0]"
      >
        <Transition name="transition-basic">
          <h1
            v-if="showTransition"
            :style="{ backgroundColor: bgColor }"
            class="html-demo-transition-heading will-change-transform transition-transform,background-color cursor-pointer duration-500 text-center p-2 text-light shadow-lg"
            @click="updateBackgroundColor"
          >
            <strong>TRANSITION + </strong><br />
            <em>occlude=blending 💛</em>
          </h1>
        </Transition>
      </Html>

      <TresGridHelper :position-y="-1.25" />
      <TresAmbientLight :intensity="1" />
    </TresCanvas>
  </div>
</template>

<style scoped>
.html-demo-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background-color: #82dbc5;
}

.html-demo-transition-heading:hover {
  transform: scale(1.05);
}

.transition-basic-enter-from,
.transition-basic-leave-to {
  opacity: 0;
  transform: translateY(-20px);
}

.transition-basic-enter-active,
.transition-basic-leave-active {
  transition: all 0.5s ease;
}

.transition-basic-enter-to,
.transition-basic-leave-from {
  opacity: 1;
  transform: translateY(0);
}
</style>
```

</details>

### Using `iframes`

You can achieve pretty cool results with the `Html` component by using iframes. For example, you can use an iframe to display a YouTube video in your scene or a webpage with a 3D model.

<scene-wrapper>
<objects-html-iframe-demo>



</objects-html-iframe-demo>
</scene-wrapper>

<details>
<summary>

Demo code

</summary>

```html
<html
  transform
  center
  :cast-shadow="true"
  :receive-shadow="true"
  occlude="blending"
  :z-index-range="[28, 0]"
  :position-y="2.5"
  :portal="portalRef"
  :style="{ userSelect: 'none' }"
>
  <iframe class="w-[700px] h-[500px]" src="https://tresjs.org" frameborder="0" :width="700" :height="500"></iframe>
</html>
```

</details>

<info>

The demos use `:z-index-range="[28, 0]"` simply to ensure the HTML elements stay below the documentation header (which uses `z-index: 30`).
**This value is for the docs only — you can ignore it or adjust it as needed.**

</info>

## Props

<table>
<thead>
  <tr>
    <th>
      Prop
    </th>
    
    <th>
      Description
    </th>
    
    <th>
      Default
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        as
      </strong>
    </td>
    
    <td>
      Wrapping <em>
        HTML element
      </em>
      
      .
    </td>
    
    <td>
      <code>
        'div'
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        wrapperClass
      </strong>
    </td>
    
    <td>
      The <code>
        className
      </code>
      
       of the wrapping element. element.
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        prepend
      </strong>
    </td>
    
    <td>
      Projects content <em>
        behind
      </em>
      
       the canvas.
    </td>
    
    <td>
      <code>
        false
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        center
      </strong>
    </td>
    
    <td>
      Adds a <code>
        transform: translate(-50%, -50%)
      </code>
      
      . <br />
      
      ➡️ <em>
        Ignored in <strong>
          transform
        </strong>
        
         mode.
      </em>
    </td>
    
    <td>
      <code>
        false
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        fullscreen
      </strong>
    </td>
    
    <td>
      Aligns to the upper-left corner and fills the screen. <br />
      
      ➡️ <em>
        Ignored in <strong>
          transform
        </strong>
        
         mode.
      </em>
    </td>
    
    <td>
      <code>
        false
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        distanceFactor
      </strong>
    </td>
    
    <td>
      Children are scaled by this factor and also by distance to a <code>
        PerspectiveCamera
      </code>
      
      , or zoom when using an <code>
        OrthographicCamera
      </code>
      
      .
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        zIndexRange
      </strong>
    </td>
    
    <td>
      Defines the <em>
        Z-order range
      </em>
      
      .
    </td>
    
    <td>
      <code>
        [16777271, 0]
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        portal
      </strong>
    </td>
    
    <td>
      Reference to a target container (for rendering into a different DOM node). container.
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        transform
      </strong>
    </td>
    
    <td>
      If <code>
        true
      </code>
      
      , applies <code>
        matrix3d
      </code>
      
       transformations — the element appears as if it is inside the 3D scene.
    </td>
    
    <td>
      <code>
        false
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        sprite
      </strong>
    </td>
    
    <td>
      Renders as a <em>
        sprite
      </em>
      
      . <br />
      
      ➡️ <em>
        Only in <strong>
          transform
        </strong>
        
         mode.
      </em>
    </td>
    
    <td>
      <code>
        false
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        calculatePosition
      </strong>
    </td>
    
    <td>
      Callback function to override the default positioning logic. <br />
      
      <strong>
        Type:
      </strong>
      
       <code>
        (object: Object3D, camera: Camera, size: { width: number; height: number }) => [number, number, number]
      </code>
      
       <br />
      
      Receives the related 3D object, the active camera, and the current viewport size, and must return <code>
        [x, y, z]
      </code>
      
       pixel coordinates for placing the HTML element. <br />
      
      ➡️ <em>
        Ignored in <strong>
          transform
        </strong>
        
         mode.
      </em>
    </td>
    
    <td>
      <a href="https://github.com/Tresjs/cientos/blob/main/src/core/misc/html/utils.ts#L9-L19" rel="nofollow">
        Default <code>
          calculatePosition
        </code>
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        occlude
      </strong>
    </td>
    
    <td>
      Enables occlusion. Possible values: <br />
      
      - <code>
        true
      </code>
      
       → Occlusion against <em>
        all
      </em>
      
       scene objects <br />
      
       - <code>
        Ref<TresObject3D>[]
      </code>
      
       → Occlusion is enabled only against the specified objects. <br />
      
      - <code>
        'blending'
      </code>
      
       → Uses a <em>
        blending-based
      </em>
      
       occlusion method (CSS-like depth blending).
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        geometry
      </strong>
    </td>
    
    <td>
      Custom <code>
        geometry
      </code>
      
       to be used.
    </td>
    
    <td>
      <a href="https://threejs.org/docs/?q=geometry#api/en/geometries/PlaneGeometry" rel="nofollow">
        <code>
          PlaneGeometry
        </code>
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        material
      </strong>
    </td>
    
    <td>
      <strong>
        Custom shader <em>
          material
        </em>
        
         used for the occlusion mesh.
      </strong>
      
       <br />
      
       <strong>
        Only applies when <code>
          occlude="blending"
        </code>
        
         is enabled
      </strong>
      
       (an occlusion mesh is created). <br />
      
       <em>
        Ignored in raycast occlusion modes (<code>
          true
        </code>
        
        , object refs).
      </em>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        transparentMaterial
      </strong>
    </td>
    
    <td>
      <strong>
        Enables <em>
          transparent
        </em>
        
         rendering for the occlusion material.
      </strong>
      
       <br />
      
       <strong>
        Only applies when <code>
          occlude="blending"
        </code>
        
         creates an occlusion mesh.
      </strong>
      
       <br />
      
       <em>
        Ignored in raycast occlusion modes (<code>
          true
        </code>
        
        , object refs).
      </em>
    </td>
    
    <td>
      <code>
        false
      </code>
    </td>
  </tr>
</tbody>
</table>

## Events

<table>
<thead>
  <tr>
    <th>
      Event
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      onOcclude
    </td>
    
    <td>
      Called when the occlusion state changes.
    </td>
  </tr>
</tbody>
</table>

## Exposed properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        instance
      </strong>
    </td>
    
    <td>
      <code>
        Ref<TresObject3D | null>
      </code>
    </td>
    
    <td>
      Reference to the root <strong>
        <code>
          <TresGroup>
        </code>
      </strong>
      
       used by <code>
        <Html>
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        isVisible
      </strong>
    </td>
    
    <td>
      <code>
        Ref<boolean>
      </code>
    </td>
    
    <td>
      Reactive value that indicates whether the HTML content is <strong>
        currently visible
      </strong>
      
       or <strong>
        occluded
      </strong>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        occlusionMesh
      </strong>
    </td>
    
    <td>
      <code>
        Ref<TresObject3D | null>
      </code>
    </td>
    
    <td>
      Reference to the <strong>
        occlusion mesh
      </strong>
      
       created when <code>
        occlude="blending"
      </code>
      
       is <strong>
        enabled
      </strong>
      
      . Used internally for geometry-based occlusion.
    </td>
  </tr>
</tbody>
</table>

## Caveats

- ✨ When using **<Html occlude>**, if the `<Html>` component is **overlapping** or **inside a 3D object**, it will be considered **occluded** and therefore **hidden**. To avoid this, **adjust the position** of the `<Html>` component in your scene.
- 🎨 When using **<Html occlude="blending">**, the HTML content is no longer **selectable** because it is rendered **behind the canvas**. This is required to achieve the blending effect.
- ⚙️ When using a **custom material** with occlusion in `blending` mode, there are a few important requirements to ensure the HTML content renders correctly ⬇️<details>
<summary>

See more information

</summary>


  1. If you provide your own material, it must be **transparent** (`transparent: true`) with an **opacity < 1**.
  2. If you are not providing a custom material, enable **transparentMaterial** so the internal shader becomes transparent.
  3. The occlusion mesh requires a **fully transparent canvas background**; otherwise, thin borders or halo artifacts may appear.
  4. To compensate for the transparent canvas, you may **reapply your previous clear-color as a CSS background** on the `html`, `body`, or a wrapper `div`.

</details>
- 🔶 When using **transparentMaterial**, overlapping `<Html>` elements (especially multiple `occlude="blending"` instances) may cause **z-index or depth-order artifacts**.
This happens because the occlusion mesh uses transparency in the WebGL layer while the DOM element uses CSS stacking order.
- 🔵 To avoid thin border artifacts when using `occlude="blending"`, make sure your `<TresCanvas>` is fully transparent:```vue
<TresCanvas :alpha="true" :clearAlpha="0" />
```

<table>
<thead>
  <tr>
    <th>
      Prop
    </th>
    
    <th>
      Description
    </th>
    
    <th>
      Default
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        as
      </strong>
    </td>
    
    <td>
      Wrapping html element.
    </td>
    
    <td>
      <code>
        'div'
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        wrapperClass
      </strong>
    </td>
    
    <td>
      The className of the wrapping element.
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        prepend
      </strong>
    </td>
    
    <td>
      Project content behind the canvas.
    </td>
    
    <td>
      <code>
        false
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        center
      </strong>
    </td>
    
    <td>
      Adds a -50%/-50% CSS transform. <span>
        Ignored in transform mode
      </span>
    </td>
    
    <td>
      <code>
        false
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        fullscreen
      </strong>
    </td>
    
    <td>
      Aligns to the upper-left corner, fills the screen. <span>
        Ignored in transform mode
      </span>
    </td>
    
    <td>
      <code>
        false
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        distanceFactor
      </strong>
    </td>
    
    <td>
      Children will be scaled by this factor, and also by distance to a PerspectiveCamera / zoom by an OrthographicCamera.
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        zIndexRange
      </strong>
    </td>
    
    <td>
      Z-order range.
    </td>
    
    <td>
      <code>
        [16777271, 0]
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        portal
      </strong>
    </td>
    
    <td>
      Reference to target container.
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        transform
      </strong>
    </td>
    
    <td>
      If true, applies matrix3d transformations.
    </td>
    
    <td>
      <code>
        false
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        sprite
      </strong>
    </td>
    
    <td>
      Renders as sprite, but only in transform mode.
    </td>
    
    <td>
      <code>
        false
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        calculatePosition
      </strong>
    </td>
    
    <td>
      Override default positioning function. <span>
        Ignored in transform mode
      </span>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        occlude
      </strong>
    </td>
    
    <td>
      Can be <code>
        true
      </code>
      
      , <code>
        Ref<TresObject3D>[]
      </code>
      
      , <code>
        'raycast'
      </code>
      
      , or <code>
        'blending'
      </code>
      
      . True occludes the entire scene.
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        geometry
      </strong>
    </td>
    
    <td>
      Custom <code>
        geometry
      </code>
      
       to be use
    </td>
    
    <td>
      <code>
        PlaneGeometry
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        material
      </strong>
    </td>
    
    <td>
      Custom shader <code>
        material
      </code>
      
       to be use
    </td>
    
    <td>
      
    </td>
  </tr>
</tbody>
</table>

## Events

<table>
<thead>
  <tr>
    <th>
      Event
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      onOcclude
    </td>
    
    <td>
      Called when the occlusion state changes.
    </td>
  </tr>
</tbody>
</table>
