Decomposition
Overview
The Styled Components can be decomposed into smaller components. At each level, you can swap out a specific component with your own custom component.
Thread
Renders an entire conversation thread.
Usage:
Thread.Root
Contains all parts of the thread. Accepts a config
prop which is used by many other styled components.
Thread.Viewport
The scrollable area containing all messages. Anchors scroll to the bottom as new messages are added.
Thread.Messages
Renders all messages. This renders a separate component for each message (passed to the components
prop).
Thread.ViewportFooter
Renders the footer of the thread viewport. This is the sticky footer that does not scroll with the messages.
Thread.ScrollToBottom
A button to scroll the viewport to the bottom. Hidden when the viewport is already at bottom.
ThreadWelcome
Renders the welcome message when no messages are present.
Usage:
Decompose Thread
into MyThread
and use MyThreadWelcome
instead of ThreadWelcome
.
ThreadWelcome.Root
Contains all parts of the welcome message.
ThreadWelcome.Center
The centered content of the welcome message.
ThreadWelcome.Avatar
The avatar of the assistant.
ThreadWelcome.Message
The welcome message.
ThreadWelcome.Suggestions
Conversation starter suggestions.
ThreadWelcome.Suggestion
A conversation starter suggestion.
Composer
Renders the composer.
Usage:
Decompose Thread
into MyThread
and use MyComposer
instead of Composer
.
Composer.Root
Contains all parts of the composer.
Composer.Input
The text input field for the user to type a new message.
Composer.Action
The button to send or cancel the message.
Composer.Send
The button to send the message.
Composer.Cancel
Sends a cancel action.
Composer.Attachments
Renders attachments.
Composer.AddAttachment
Renders an add attachment button.
AttachmentUI
AttachmentUI
is still experimental.
Renders an attachment.
AttachmentUI.Root
Contains all parts of the composer attachment.
AttachmentUI.Remove
Renders a remove attachment button.
AssistantMessage
Renders an assistant message.
Usage:
Decompose Thread
into MyThread
and pass MyAssistantMessage
to Thread.MEssages
AssistantMessage.Root
Contains all parts of the assistant message.
AssistantMessage.Avatar
The avatar of the assistant.
AssistantMessage.Content
The content of the assistant message.
AssistantActionBar
Renders the action bar for the assistant message.
Usage:
Decompose AssistantMessage
into MyAssistantMessage
and use MyAssistantActionBar
instead of AssistantActionBar
.
AssistantActionBar.Root
Contains all parts of the assistant action bar.
AssistantActionBar.Reload
Shows a reload button.
AssistantActionBar.Copy
Shows a copy button.
AssistantActionBar.SpeechControl
Shows a speech control button (either Speak or StopSpeaking).
AssistantActionBar.Speak
Shows a speak button.
AssistantActionBar.StopSpeaking
Shows a stop speaking button.
AssistantActionBar.FeedbackPositive
Shows a positive feedback button.
AssistantActionBar.FeedbackNegative
Shows a negative feedback button.
BranchPicker
Renders the branch picker.
Usage:
Decompose AssistantMessage
and UserMessage
and use MyBranchPicker
instead of BranchPicker
.
BranchPicker.Root
Contains all parts of the branch picker.
BranchPicker.Previous
Shows a previous button.
BranchPicker.Next
Shows a next button.
BranchPicker.State
Shows the current branch number and total number of branches.
BranchPicker.Number
The current branch number.
BranchPicker.Count
The total number of branches.
UserMessage
Renders a user message.
Usage:
Decompose Thread
into MyThread
and pass MyUserMessage
to Thread.Messages
UserMessage.Root
Contains all parts of the user message.
UserMessage.Content
The content of the user message.
UserMessage.Attachments
Renders attachments.
UserActionBar
Renders the action bar for the user message.
Usage:
Decompose UserMessage
into MyUserMessage
and use MyUserActionBar
instead of UserActionBar
.
UserActionBar.Root
Contains all parts of the user action bar.
UserActionBar.Edit
Shows an edit button.
UserAttachment
Renders an attachment.
UserAttachment.Root
Contains all parts of the user attachment.
EditComposer
Renders a user message being edited.
Usage:
Decompose Thread
into MyThread
and pass MyEditComposer
to Thread.Messages
.
EditComposer.Root
Contains all parts of the edit composer.
EditComposer.Input
The text input field for the user to type a new message.
EditComposer.Footer
The footer of the edit composer.
EditComposer.Cancel
Sends a cancel action.
EditComposer.Send
Sends the message.
AssistantModal
Renders the assistant modal.
Usage: