component
Chat Background
The tiled doodle wallpaper, drawn as a themed CSS mask so it tints with the rest.
Install
npx shadcn@latest add https://whatsapp-components.crafter.run/r/chat-background.jsonWrites 4 files into your project, and installs clsx and tailwind-merge.
Preview
Con garabatos
Sin garabatos
demos/chat-background.tsx
import { ChatBackground } from "@/registry/whatsapp/chat-background";
import { MessageBubble } from "@/registry/whatsapp/message-bubble";
export default function Demo() {
return (
<div className="grid gap-4 sm:grid-cols-2">
<div className="relative h-40 overflow-hidden rounded-lg">
<ChatBackground />
<div className="relative p-3">
<MessageBubble direction="in">Con garabatos</MessageBubble>
</div>
</div>
<div className="relative h-40 overflow-hidden rounded-lg">
<ChatBackground pattern={false} />
<div className="relative p-3">
<MessageBubble direction="in">Sin garabatos</MessageBubble>
</div>
</div>
</div>
);
}Props
Read from ChatBackgroundProps in the component source at build time.
| Prop | Type | Default |
|---|---|---|
className | string | — |
patternHide the doodles and keep the flat wallpaper colour. | boolean | true |
Files
- registry/whatsapp/chat-background.tsx
- registry/whatsapp/cn.ts
- registry/whatsapp/whatsapp.css
- LICENSE