Usage
Chat Tokenized Text renders read-only output which shares token definitions with Composer Input. It belongs to the Chat family but can be used wherever serialized composer text needs safe display.
import "@nordhealth/components/lib/ChatTokenizedText"
Composition
Set value to the canonical plain string and tokens to known token definitions.
Examples
Token reconstruction
Only exact boundary-matched values become Chat Composer Token elements. Unknown values, overlapping definitions, and hostile strings remain ordinary text rather than being interpreted as markup.
Accessibility
The component preserves reading order and exposes token labels as text. Definitions should use human-readable labels, and surrounding copy should not depend on token color to communicate meaning.
Templates
See this component composed into complete application views:
API reference
ChatTokenizedText
Safely reconstructs known Composer Tokens from a canonical serialized string.
It creates only text nodes and token elements and never parses consumer HTML.
Consumer children are left untouched. When both meaningful consumer content
and value exist, consumer content wins so output is never duplicated.
Token values match only at word/marker boundaries, never inside larger words.
<nord-chat-tokenized-text></nord-chat-tokenized-text>Props
| Property | Attribute | Description | Type | Default |
|---|---|---|---|---|
value | value | Canonical plain-text message to render. | string | undefined | — |