> For the complete documentation index, see [llms.txt](https://docs.plume.moe/norska/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.plume.moe/norska/core/attach.md).

# Attach

Use `attach` to link objects to their parent.&#x20;

If  the directive's element is removed from the DOM, it will automatically detach from its parent.

The following example shows how to attach a material and a geometry to a mesh object:

```html
<div x-3.mesh>
    <br         
        x-3.boxGeometry="[1, 1, 1]"
        x-3.attach.geometry
    />
    <br         
        x-3.meshBasicMaterial="{color: 0xff0000}"
        x-3.attach.material
    />
</div>
```
