Skip to content

graphemeSegments

graphemeSegments(text): readonly string[]

Defined in: visible-width.ts:23

Splits text into user-perceived characters (Unicode grapheme clusters), after stripping control characters (undefined width in any monospace rendering).

A cluster groups a base character with its combining marks and ZWJ sequences (flags, multi-part emoji), so those never contribute extra width on top of their base character in visibleWidth.

string

readonly string[]