packages/components/eui-discussion-thread/eui-discussion-thread.component.ts
A component for displaying threaded discussions or conversation timelines in a structured format. Renders a list of discussion items with support for titles, subtitles, and tooltips. Ideal for comment threads, activity feeds, chat histories, and collaborative communication interfaces.
// Component
discussionItems: EuiDiscussionThreadItem[] = [
{
author: 'John Doe',
timestamp: new Date(),
message: 'First comment'
},
{
author: 'Jane Smith',
timestamp: new Date(),
message: 'Reply to comment'
}
];
// Template
<eui-discussion-thread
[items]="discussionItems"
[titleLabel]="'Project Discussion'"
[subTitleLabel]="'Team Collaboration'">
</eui-discussion-thread><eui-discussion-thread
[titleLabel]="'Comments'"
[tooltip]="'Discussion thread for this task'">
<eui-discussion-thread-item
[author]="'Alice'"
[timestamp]="date1"
[message]="'Initial comment'">
</eui-discussion-thread-item>
<eui-discussion-thread-item
[author]="'Bob'"
[timestamp]="date2"
[message]="'Follow-up response'">
</eui-discussion-thread-item>
</eui-discussion-thread>role="list" when items are presentrole="listitem" for proper structureitems array) and content projection approachestitleLabel and subTitleLabel for thread categorizationeui-discussion-thread-item children| selector | eui-discussion-thread |
| imports |
EuiDiscussionThreadItemComponent
EUI_ICON
EUI_LABEL
|
| styleUrls | ./eui-discussion-thread.scss |
| templateUrl | ./eui-discussion-thread.component.html |
Inputs |
HostBindings |
Accessors |
| items |
Type : EuiDiscussionThreadItem[]
|
|
Array of discussion thread items to be displayed. Each item should conform to the EuiDiscussionThreadItem interface. |
| subTitleLabel |
Type : string
|
|
The subtitle label for the discussion thread, typically used to provide additional context or categorization. |
| titleLabel |
Type : string
|
|
The main title label for the discussion thread. |
| tooltip |
Type : string
|
|
Tooltip text to display when hovering over the discussion thread. |
| attr.role |
Type : string
|
|
ARIA role for the host element to ensure proper accessibility. |
| class |
Type : string
|
|
Gets the CSS classes to apply to the host element. |
| cssClasses |
getcssClasses()
|
|
Gets the CSS classes to apply to the host element.
Returns :
string
|
| checkRole |
getcheckRole()
|
|
ARIA role for the host element to ensure proper accessibility.
Returns :
string
|