Hi. Ask me anything about Club Med. I'm here to help you find the right information quickly.
Getting Started
Components
- Advanced Toast
- ArrowButton
- Arrows
- Avatar
- Backdrop
- Basic Toast
- Breadcrumb
- Button
- CardBackground
- Card
- Carousel
- ChatButton
- ChatInput
- ChatMessage
- ChatTypingIndicator
- ChatWindow
- CheckboxSelect
- Checkbox
- Checkboxes
- Chip
- ChoiceExpander
- Clickable
- Date Field
- Dropdown
- ElasticHeight
- ExpandableCard
- Filter
- Form Control
- Form Label
- Frame
- HamburgerIcon
- Heading
- Image
- Link
- Loader
- Number Field
- Pagination
- Password
- Phone Field
- Popin
- Portal
- Prose
- Radio Group
- Radio
- Range
- Scrollbar
- Select
- SidebarLayout
- SliderFrame
- Spinner
- Switch
- Tabs
- Tag
- TextField
- Tooltip
- ValidationMessage
My son is 14 years old, and I would like to find activities for him during our stay. What do you suggest?
'use client';
import { ChatMessage } from '@/ui/ChatMessage';
export function ChatMessageDemo() {
return (
<div className="w-[380px] flex flex-col gap-4">
<ChatMessage sender="assistant">
Hi. Ask me anything about Club Med. I'm here to help you find the right information
quickly.
</ChatMessage>
<ChatMessage sender="user">
My son is 14 years old, and I would like to find activities for him during our stay. What do
you suggest?
</ChatMessage>
</div>
);
}
Installation
npx shadcn@latest add https://develop.trident-ui.pro.clubmed/r/chat-message.json
Usage
import { ChatMessage } from '@/ui/ChatMessage';
export function Component() {
return (
<>
<ChatMessage sender="assistant">Hi. Ask me anything about Club Med.</ChatMessage>
<ChatMessage sender="user">What activities are available for children?</ChatMessage>
</>
);
}API Reference
ChatMessage
| Prop | Type | Default | Description |
|---|---|---|---|
sender | "assistant" | "user" | — | Required. Determines alignment and styling |
children | ReactNode | — | Message content |
className | string | undefined | Additional CSS classes |
Inherits all HTMLDivElement attributes.
Notes
- Assistant messages are left-aligned with no background.
- User messages are right-aligned with a
pearlbackground pill. - Both use
role="article"with a descriptivearia-labelfor screen reader support. - Used inside
ChatWindowas part of the message list.