(this page was created automatically. In case of formatting issues, please visit the official Wiki Page)

Chat

Overview

Example Chat

Specs

Tokens

Token Description
id Unique identifier for the component.
displayName Display name in the structure panel.
botMessageRatingIcons Icons used to rate bot messages.
name Icon identifier within botMessageRatingIcons.
tooltipTranslations Localized tooltip text map.
alternateIcon Alternate icon for toggling state.
isClickableOnce Limits an icon to a single click.
events List of event actions (component and icon).
ON_INIT (Events) Fires on component initialization.
ON_DESTROY (Events) Fires when component is removed.
ON_GLOBAL_PARAMETERS_CHANGE (events) Fires when relevant global parameters change.
ON_DATA_HUB_CHANGE (events) Fires when the Data Hub context/state changes.
ON_SEND_MESSAGE (Events) Triggered when a user sends a message.
ON_CONTENT_CLICK (Events) Triggered on content click within a message.
ON_ICON_CLICK (Events) Triggered when a rating icon is clicked.
maxMessageLength Max characters allowed in user input.
paddingClass CSS padding classes for the component.
visibilityPolicySetId Policy set controlling component visibility.
dataTestId Identifier used for automated testing.

Structure

(Configured in General Properties)

(Configured in Data Documentation)

  {
    "type": "user",
    "question": "How can I reset my password?",
    "timestamp": 1697800000000
  }

[IMAGE PLACEHOLDER: High-level structure showing displayName/id and the message array]

Styling

(Configured in Visual Properties)

  [
    {
      "name": "thumbs-up",
      "tooltipTranslations": { "en-US": "Helpful", "de-DE": "Hilfreich" },
      "alternateIcon": "thumbs-up-filled",
      "isClickableOnce": true,
      "events": [/* ... */]
    }
  ]

Actions

(Configured in Event Actions)

  [
    { "type": "ON_SEND_MESSAGE", "actions": [/* ... */] },
    { "type": "ON_CONTENT_CLICK", "actions": [/* ... */] }
  ]
    ```
    - **ON_INIT** – Triggered when the label component is initialized. Can be used to perform setup operations like setting initial context values.
    - **ON_DESTROY** – Triggered when the label component is removed from the DOM. Useful for cleanup operations and releasing resources.
    - **ON_GLOBAL_PARAMETERS_CHANGE** – Triggered when global parameters that might affect the component change.
    - **ON_DATA_HUB_CHANGE** - Emitted whenever the Data Hub’s active context or state changes.
    - **ON_SEND_MESSAGE** — Triggered when a user sends a message. Can be used to invoke backend APIs or trigger workflows.
    - **ON_CONTENT_CLICK** — Triggered when a user clicks on content within a message. Useful for handling links or interactive elements.
    - **ON_ICON_CLICK** — Triggered when a bot message rating icon is clicked. Allows for custom feedback handling or analytics.

### Tests
*(Configured in Testing Hooks)*
- **dataTestId** — Sets the testing hook ID for automated testing. Makes it easier to select the component in end-to-end or unit tests.  
  Example: `"support-chat-component"`

### Authorization
*(Configured in Authorization)*
- **visibilityPolicySetId** — Determines the visibility of the component based on a policy set. Restricts access to certain users or roles.  
  Example: `"supportAgentsOnly"`

### Links
- Figma: tba
- Live style guide: tba

## Guidelines

### Example Configuration

json { "id": "supportChat", "displayName": "Support Chat", "botMessageRatingIcons": [ { "name": "thumbs-up", "tooltipTranslations": { "en-US": "Helpful" }, "alternateIcon": "thumbs-up-filled", "isClickableOnce": true, "events": [{ "type": "ON_ICON_CLICK", "actions": [] }] } ], "maxMessageLength": 500, "events": [ { "type": "ON_SEND_MESSAGE", "actions": [] }, { "type": "ON_CONTENT_CLICK", "actions": [] } ], "dataTestId": "support-chat-component" } ```

Guidelines

Usage

Sizing & Layout

States & Feedback

Tooltips

Interactions & Events

Data-Driven / Conditional Behavior

Visibility & Authorization

Content & Localization

Dos & Don’ts

Do Don’t Article setting(s)
Limit user input to an appropriate maximum (e.g., to keep latency down). Allow unbounded message length that slows or breaks processing. maxMessageLength
Offer only the key rating choices (e.g., up/down). Present a cluttered row of many nuanced reaction icons. botMessageRatingIcons[], botMessageRatingIcons[].name
Show a clear “rated” state by swapping to the alternate icon. Change only color to indicate rating. botMessageRatingIcons[].alternateIcon
Prevent repeat ratings when they would skew analytics. Let users toggle the same rating repeatedly. botMessageRatingIcons[].isClickableOnce
Localize each rating tooltip with short, action-oriented text. Leave tooltips in a single language or overly long. botMessageRatingIcons[].tooltipTranslations
Wire rating interactions to your handler chain. Leave icons inert (no action on click). events, ON_ICON_CLICK
Handle taps on links or interactive message content. Ignore message content clicks and rely on default browser behavior. events, ON_CONTENT_CLICK
Add spacing with the built-in padding token for readability. Depend on external wrappers to fix spacing. paddingClass
Hide the chat when access isn’t permitted. Show the chat and attempt to block usage via content alone. visibilityPolicySetId

Accessibility