Learn how to customize the C1 chat experience by adding a component to the footer of a response.
@thesysai/genui-sdk
package provides a way to add a response footer via the C1Chat
component. You can use the pre-built components that come with the SDK for common actions.
Here’s how to add a response footer using the pre-built components:
Create a response footer component
ResponseFooter
export.First, create a new component that will wrap your footer elements. This component must be of type ResponseFooterComponent
, which will provide it with threadId
and messageId
props. Then, use ResponseFooter.Container
as a wrapper and add the desired buttons inside it.ResponseFooter
component is meant for convenience. If you need more control over the footer, you can create your own component. As long as your
component adheres to the ResponseFooterComponent
type, it can be passed to the C1Chat
component.ShareButton
, ThumbsUpButton
, and ThumbsDownButton
:ResponseFooterComponent
receives messageId
and threadId
, which you can use in your click handlers and backend API calls.Pass the custom component to C1Chat
FooterComponent
to the C1Chat
component via the customizeC1
prop.Customize the pre-built components (optional)
ResponseFooter
components accept props to customize their behavior.ResponseFooter.Container
className
and animate
props.ResponseFooter.ShareButton
message
object and should return a promise
that resolves to a shareable URL. The button handles the UI for copying the
link to the clipboard and shows a confirmation.ResponseFooter.ThumbsUpButton
& ResponseFooter.ThumbsDownButton
IconButton
component with tertiary
as the default variant. For details on all the props that they accept, refer to Crayon’s
IconButton documentation.Test it out