Skip to content

pantoken-root / renderers/web-components/src / truncate

ตัวแปร: truncate ​

const truncate: ElementDefinition

อัลฟา

<instui-truncate> — clamps slotted text to a fixed number of lines with an ellipsis. lines accepts a positive integer or auto. A number sets the --lines custom property directly. auto computes a line count from the host's available height and applies that as --lines. Omit lines for single-line truncation.

ตัวอย่าง ​

html
<instui-truncate lines="2">คำอธิบายยาวที่จะถูกจำกัดให้เป็นสองบรรทัด…</instui-truncate>