component
System Message
The centred pill: payment confirmed, encryption notice, anything not from a person.
Install
npx shadcn@latest add https://whatsapp-components.crafter.run/r/system-message.jsonWrites 5 files into your project, and installs clsx and tailwind-merge.
Preview
Messages are end-to-end encrypted.
Pago confirmado
Cambiaste el asunto del grupo
Venta cerrada
demos/system-message.tsx
import { SystemMessage } from "@/registry/whatsapp/system-message";
export default function Demo() {
return (
<div className="flex flex-col gap-1">
<SystemMessage tone="encryption">
Messages are end-to-end encrypted.
</SystemMessage>
<SystemMessage tone="success">Pago confirmado</SystemMessage>
<SystemMessage>Cambiaste el asunto del grupo</SystemMessage>
<SystemMessage
icon={null}
className="[&>span]:bg-wa-accent [&>span]:font-semibold [&>span]:text-wa-accent-text"
>
Venta cerrada
</SystemMessage>
</div>
);
}Props
Read from SystemMessageProps in the component source at build time.
| Prop | Type | Default |
|---|---|---|
childrenrequired | ReactNode | — |
className | string | — |
iconRendered before the text. Pass `null` to drop the tone's default icon. | ReactNode | null | — |
tone | SystemNoticeTone | "neutral" |
Files
- registry/whatsapp/system-message.tsx
- registry/whatsapp/types.ts
- registry/whatsapp/cn.ts
- registry/whatsapp/whatsapp.css
- LICENSE