Components API
Diagram
Below is a diagram of the components that make up the package.
Root
Chat
AppBar
| Name | Type | Default |
|---|---|---|
content | ReactNodeContent to display in the header | |
theme | ChatThemeCustom theme for the appbar | chatTheme |
ChatBubble
Sessions
SessionsList
NewSessionButton
SessionGroups
| Name | Type | Default |
|---|---|---|
children | (groups: GroupedSessions[]) => ReactNodeRender function for the session groups. |
SessionsGroup
SessionListItem
Messages
SessionMessages
SessionMessage
SessionMessagePanel
| Name | Type | Default |
|---|---|---|
allowBack | booleanWhether to show the back button to return to the session list in compact mode. | true |
SessionMessagesHeader
| Name | Type | Default |
|---|
SessionEmpty
| Name | Type | Default |
|---|
MessageQuestion
| Name | Type | Default |
|---|---|---|
question | stringQuestion to render. | |
files | ConversationFile[]Array of sources referenced in the conversation |
MessageResponse
MessageActions
MessageSources
MessageSource
| Name | Type | Default |
|---|---|---|
limit | numberLimit for the title. | |
url | stringURL of the source, if applicable | |
title | stringTitle or description of the source | |
image | stringImage URL of the source, if applicable. |
MessageFiles
MessageFile
Input
ChatInput
RichTextInput
MentionList
FileInput
Suggestions
ChatSuggestions
ChatSuggestion
| Name | Type | Default |
|---|---|---|
onClick | (suggestion: string) => voidCallback when the suggestion is clicked. | |
id | stringUnique identifier for the suggestion | |
content | stringThe display text for the suggestion |
Status
MessageStatus
MessageStatusItem
StatusIcon
Markdown
Markdown
CodeHighlighter
TableComponent
| Name | Type | Default |
|---|
TableHeaderCell
| Name | Type | Default |
|---|
TableDataCell
| Name | Type | Default |
|---|
Component Catalog
ComponentRenderer
ComponentError
ChartRenderer
| Name | Type | Default |
|---|---|---|
config | ChartConfigThe chart configuration. | |
className | stringThe class name to apply to the chart container. |
File Renderers
MessageFile routes attachments to one of these renderers based on the fileβs
MIME type. They are also exported individually if you want to compose your own
file UI.
ImageFileRenderer
CSVFileRenderer
| Name | Type | Default |
|---|---|---|
name | stringName of the file. | |
url | stringURL of the file. | |
fileIcon | ReactElement<unknown, string | JSXElementConstructor<any>>Icon to for file type. |
PDFFileRenderer
| Name | Type | Default |
|---|---|---|
name | stringName of the file. | |
url | stringURL of the file. | |
fileIcon | ReactElement<unknown, string | JSXElementConstructor<any>>Icon to for file type. |