component
Chat Window
The shell: sets the theme, the wallpaper colour and the font for everything inside.
Install
npx shadcn@latest add https://whatsapp-components.crafter.run/r/chat-window.jsonWrites 5 files into your project, and installs clsx and tailwind-merge.
Preview
Valeria · Agente IA
online
ChatWindow sets the theme, the wallpaper and the font.
Everything inside inherits from it.
demos/chat-window.tsx
import { ChatHeader } from "@/registry/whatsapp/chat-header";
import { ChatInput } from "@/registry/whatsapp/chat-input";
import { ChatWindow } from "@/registry/whatsapp/chat-window";
import { MessageBubble } from "@/registry/whatsapp/message-bubble";
import { MessageList } from "@/registry/whatsapp/message-list";
export default function Demo() {
return (
<ChatWindow className="h-[360px] overflow-hidden rounded-lg">
<ChatHeader name="Valeria · Agente IA" presence="online" />
<MessageList>
<MessageBubble direction="in">
ChatWindow sets the theme, the wallpaper and the font.
</MessageBubble>
<MessageBubble direction="out">
Everything inside inherits from it.
</MessageBubble>
</MessageList>
<ChatInput placeholder="Escribe un mensaje" />
</ChatWindow>
);
}Props
Read from ChatWindowProps in the component source at build time.
| Prop | Type | Default |
|---|---|---|
childrenrequired | ReactNode | — |
className | string | — |
style | CSSProperties | — |
themeSets data-wa-theme on the shell so the tokens resolve for everything inside. | WhatsAppThemeId | (string & {}) | — |
Files
- registry/whatsapp/chat-window.tsx
- registry/whatsapp/themes.ts
- registry/whatsapp/cn.ts
- registry/whatsapp/whatsapp.css
- LICENSE