ChatHeader

The ChatHeader component is rendered at the top of the chat panel.

Props

The ChatHeader component receives the following props:

NameTypeDescription
conversationConversationThe conversation being rendered
showSearchButtonbooleanWhether the search button should be shown
showSearchBoxbooleanWhether the search box should be shown
showCloseButtonbooleanWhether the close button in the pop-up widget should be shown
showActionMenubooleanWhether the conversation actions menu should be shown
presenceEnabledbooleanWhetether the current user's role has the option enabled to show the online status of other users.

Available system components

The following system components are available to the ChatHeader component:

The <SearchBox> system component lets users search through the current conversation.

Props

NameTypeDescription
clssstringThe class given to the search box's outer div
stylestringCSS styles given to the search box's outder div

Usage example

This example renders the search button with an icon inside

1<SearchBox class="search-box" style="width: 100%;" />

SearchButton

The <SearchButton> system component makes the search box visible.

Props

NameTypeDescription
classstringThe class given to the button
stylestringCSS styles given to the button

Usage example

This example renders the search button with an icon inside.

1<SearchButton class="search-button" style="background-color: #a0a0a0;">
2 <Icon type="search" />
3</SearchButton>

CloseButton

The <CloseButton> system component closes the pop-up.

Props

NameTypeDescription
classstringThe class given to the button
stylestringCSS styles given to the button

Usage example

1<CloseButton class="close-button" style="width: 100%"">
2 <Icon type="close" />
3</CloseButton>

StatusIndicator

The <StatusIndicator> system component shows whether a user is online.

Props

NameTypeDescription
classstringThe class given to the status indicator
stylestringCSS styles given to the status indicator
user RequiredUserUser for which the online status should be displayed

Usage example

Thiks example renders a list of conversation participants, each with a status indicator.

1<ul class="users">
2 <li class="user inline-block" t:for="{{ user in conversation.others }}" t:key="{{ user.id }}">
3 <span>{{user.name}}</span>
4 <StatusIndicator class="status-indicator" user="{{user}}" />
5 </li>
6</ul>

ActionMenu

The <ActionMenu> subcsystem component renders a button that opens a menu with available conversation actions.

Props

NameTypeDescription
classstringThe class given to the button

Usage example

This example renders the button to open the action menu, with an icon of three horizontal dots inside.

1<ActionMenu class="action-menu">
2 <Icon type="horizontalDots" />
3</ActionMenu>

ActionButton

A button that emits a custom conversation action event when clicked.

Props

NameTypeDescription
classstringThe class given to the button
action RequiredstringName of the action that gets triggered
data-<foo>stringParameters you want to pass along with the action event.

The values of any attributes starting with data- will be passed along.

Example usage

This example renders a button that triggers a ConversationAction event when clicked. The event will have an action set to "viewOrder", and include an orderId property taken from a custom attribute set on the conversation.

1<ActionButton action="viewOrder" data-orderId="{{conversation.custom.orderId}}">
2 Confirm attendance
3</ActionButton>

The <ActionLink> system component behaves the same as <ActionButton>, except that it is rendered as a link.

Props

NameTypeDescription
classstringThe class given to the link
action RequiredstringName of the action that gets triggered
data-<foo>stringParameters you want to pass along with the action event.

The values of any attributes starting with data- will be passed along.

Example usage

This example renders a link that triggers a ConversationAction event when clicked. The event will have an action set to "viewOrder", and include an orderId taken from a custom attribute set on the conversation.

1<ActionLink action="confirmAttendance" data-orderId="{{conversation.custom.orderId}}">
2 Confirm attendance
3</ActionLink>