Browse components

component

Message Meta

Timestamp, edited marker and delivery ticks, sized to sit inside a bubble.

Install

npx shadcn@latest add https://whatsapp-components.crafter.run/r/message-meta.json

Writes 7 files into your project, and installs clsx and tailwind-merge.

Preview

Corto: la hora entra en la última línea.
Cuando el texto llena el ancho hasta el borde mismo del globo, la hora baja sola a su propia línea.edited
Reloj de 24 horas.
demos/message-meta.tsx
import { MessageBubble } from "@/registry/whatsapp/message-bubble";
import { MessageMeta } from "@/registry/whatsapp/message-meta";

const sentAt = new Date(2025, 0, 6, 20, 2);

export default function Demo() {
  return (
    <div className="flex flex-col gap-3">
      <MessageBubble
        direction="out"
        meta={<MessageMeta timestamp={sentAt} status="read" />}
      >
        Corto: la hora entra en la última línea.
      </MessageBubble>

      <MessageBubble
        direction="out"
        meta={<MessageMeta timestamp={sentAt} status="delivered" edited />}
      >
        Cuando el texto llena el ancho hasta el borde mismo del globo, la hora
        baja sola a su propia línea.
      </MessageBubble>

      <MessageBubble
        direction="out"
        meta={
          <MessageMeta
            timestamp={sentAt}
            status="sent"
            timeFormat={{ hour12: false }}
          />
        }
      >
        Reloj de 24 horas.
      </MessageBubble>
    </div>
  );
}

Props

Read from MessageMetaProps in the component source at build time.

MessageMetaProps
PropTypeDefault
timestamprequiredDate—
classNamestring—
editedboolean—
editedLabelstring"edited"
status

Ticks render only for outgoing messages, matching WhatsApp.

MessageStatus—
timeFormatTimeFormatOptions—

Files

  • registry/whatsapp/message-meta.tsx
  • registry/whatsapp/message-ticks.tsx
  • registry/whatsapp/format-time.ts
  • registry/whatsapp/types.ts
  • registry/whatsapp/cn.ts
  • registry/whatsapp/whatsapp.css
  • LICENSE