# LinkLabel

Import it from `@grafloria/engine`.

```ts
interface LinkLabel
```

**Properties**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `id` | `string` |  |  |
| `text` | `string` |  |  |
| `position` | `number` |  |  |
| `offset` | `Point` |  |  |
| `style?` | `LabelStyle` |  |  |
| `rotation?` | `'auto' \| number` |  |  |
| `rotationOffset?` | `number` |  |  |
| `keepUpright?` | `boolean` |  |  |
| `textAnchor?` | `'start' \| 'middle' \| 'end'` |  |  |
| `textBaseline?` | `'top' \| 'middle' \| 'bottom'` |  |  |
| `textWrap?` | `boolean` |  |  |
| `maxWidth?` | `number` |  |  |
| `autoOffset?` | `boolean` |  | Auto-position this label so it does not overlap nodes, other labels or links. Handled by the diagram-wide edge optimizer: `offset` is the label's PREFERRED placement and the optimizer searches outward from it only when it collides. |
| `segmentIndex?` | `number` |  |  |
| `slot?` | `LinkLabelSlot` |  | One of the three edge slots. Shorthand for `position`; ignored when the label carries an explicit `position` (see LinkLabelSlot). |
| `html?` | `string` |  | Render this label as ARBITRARY HTML inside a `foreignObject` instead of SVG text. The string is injected verbatim, so it is the author's job to keep it trusted/escaped — exactly like any `innerHTML` seam. |
| `template?` | `string` |  | Name of a label template registered with `registerLabelTemplate` (@grafloria/renderer). The template returns VNodes, so it can emit SVG or a `foreignObject` full of HTML. Wins over `html`. |
| `width?` | `number` |  | Width of the HTML/template label's box (px). Default 120. |
| `height?` | `number` |  | Height of the HTML/template label's box (px). Default 28. |
