---
url: /api/formats/interactions/src/functions/initTruncateAuto.md
---
[pantoken-root](../../../../index.md) / [formats/interactions/src](../index.md) / initTruncateAuto

# Function: initTruncateAuto()

> **initTruncateAuto**(`host`, `target`, `options?`): [`TruncateAutoHandle`](../interfaces/TruncateAutoHandle.md)

Keep `--lines` in sync with available height for an auto-clamped truncate target.

* CSS usage: pass the same element as `host` and `target`.
* Web-component usage: pass custom-element host + shadow truncate target span.

## Parameters

### host

`HTMLElement`

### target

`HTMLElement`

### options?

[`TruncateAutoOptions`](../interfaces/TruncateAutoOptions.md)

## Returns

[`TruncateAutoHandle`](../interfaces/TruncateAutoHandle.md)
