Has the release gone out yet?
Chat
TwMessage
TwMessage is a Blazor chat message row with an avatar, the author, the time, the message content and a footer, aligned to the start or end of a conversation.
Last updated
Please be aware this component is new, may have bugs and/or be subject to change. Please report any bugs at
https://github.com/twblazor/twblazor/issues.
Basic usage
Give
TwMessage an Author and a Timestamp, and put the message itself in a TwBubble. The avatar shows the author's initials. Wrap the conversation in a container with role="log" so screen readers announce new messages.Not yet, the last build is still running.
Your own messages
Set
Align to MessageAlign.End for the current user's messages. The avatar moves to the end edge, and any TwBubble inside follows the alignment and points its tip at the avatar.How can I help today?
Summarise yesterday's support tickets, please.
Continued messages
Set
Continued on a message that follows another from the same author. Its avatar and header are hidden from view so the messages read as one group, but the author and time are still read out to screen readers.Quick update on the launch.
The copy is signed off.
Images are going in this afternoon.
An assistant conversation
The chat components work together:
TwMarker for the steps an assistant took and for date separators, TwAttachment for files, and TwBubble reactions for feedback.Today
q3-sales.xlsx47.1 KB · XLSX
Which region grew the most last quarter?
Read q3-sales.xlsx0.4sDone
Compared regions1.2sDone
The North region grew the most, with sales up 18% on the quarter before.
Accessibility
Each message is an
article named by its author and time, so screen reader users can jump from message to message. The avatar is decoration, since the author's name is written beside it. A continued message keeps its author and time for screen readers. Put the conversation in a container with role="log" and an aria-label, so new messages are announced politely as they arrive.
Theme configuration
Styling is controlled by
TwBlazorTheme.Components (a TwMessageTheme), configured via the
AddTwBlazor() options callback described on the Get Started page.
Every property is a set of Tailwind classes, so changes are picked up by your own Tailwind build.
Full reference: TwMessageTheme on the API docs.