Skip to content

Commit

Permalink
docs(ai-chat-log): doucment how to animate markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
krisantrobus committed Jan 22, 2025
1 parent deb5441 commit 4d47a2d
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@ The `AIChatMessageBody` component has an optional `animated` prop that can be us

It also accepts `onAnimationStart` and `onAnimationEnd` props to trigger actions when the animation starts and ends allowing additional logic such as scrolling to be implemented.

If you are using a Markdown parser to render the message body we recommend using [markdown-to-jsx](https://www.npmjs.com/package/markdown-to-jsx). It allows you to pass in paste elements to replace specific markdown elements. You can view our implementation for the [Paste Assistant](/assistant) for an example. [AIChatMessageBody implementation](https://github.com/twilio-labs/paste/blob/main/packages/paste-website/src/components/assistant/AssistantMessage.tsx#L27), [Markdown options implementation](https://github.com/twilio-labs/paste/blob/main/packages/paste-website/src/components/assistant/AssistantMarkdown.tsx#L46)

<LivePreview
scope={{
useAIChatLogger,
Expand Down

0 comments on commit 4d47a2d

Please sign in to comment.