# Attach a drawable to geometry

[Canonical page](https://nothing.graphics/docs/format/guides/attach-geometry) · [Page source on GitHub](https://github.com/gridaco/nothing/blob/main/ncf/docs/guides/attach-geometry.md)

Place an object on bounds, along a contour, or at a vertex and keep it there through edits.



Put the attached `shape`, `group`, or `sequence` inside the shape that owns the geometry. That nearest enclosing shape is its host. A top-level drawable uses the scene viewport as its host. Groups and inline sequences pass through the nearest host to their children and can transform those children in the ordinary way. A referenced scene starts with its own viewport and hosts. [Host rules](https://nothing.graphics/docs/format/spec/attached-drawables#hosts)

| To attach at…                   | Use            | Example                                                                                                                                                                                                            |
| ------------------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| A point in the host’s bounds    | `u` and/or `v` | `u="1" v="0.5"` places the attachment at the midpoint of the right edge. Use this for a card badge or a marker at the edge of a caption box.                                                                       |
| A share of one directed contour | `along`        | `along="0.5"` goes halfway by distance. Add `orient="auto"` to face the outgoing tangent.                                                                                                                          |
| A particular authored point     | `vertex`       | `vertex="1"` follows the second point, counting from zero. `vertex="1.5"` is halfway along the next stretch. An automatically oriented interior vertex faces the bisector of the incoming and outgoing directions. |

Use one locator kind for each drawable. A path with separate subpaths supplies bounds, but has no single contour for `along`. Text supplies layout bounds. Its glyph outlines have separate uses in masks and booleans. [Available locators by geometry](https://nothing.graphics/docs/format/spec/attached-drawables#what-a-geometry-offers)

## Keep a badge mounted during resize [#keep-a-badge-mounted-during-resize]

In the [card case](https://github.com/gridaco/nothing/blob/main/ncf/conformance/attached-drawables/04-card.nothing), inspect the drawable with both `u` and `v` set. Edit the host rectangle’s width and sample again. A bounds locator follows the new extent while the badge keeps its own size. Scaling the enclosing shape instead scales both the host and the attached content. Place the badge after the geometry element to paint it above the host’s paint. The same child placed before the geometry paints below it. [Placement and paint order](https://nothing.graphics/docs/format/spec/attached-drawables#order-and-compositing)

For a timed example, [animate an arrowhead that follows a route](https://nothing.graphics/docs/format/guides/animate-a-property). Its keyed locator and stroke trim use the same distance. Ordinary drawable translation adds a relative offset at the attached point. If automatic facing is on, the offset turns with the contour. [Attachment transforms](https://nothing.graphics/docs/format/spec/attached-drawables#placing-an-attached-drawable)
