Browse components

component

Location Message

A pinned map card that falls back to a drawn placeholder when there is no maps key.

Install

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

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

Preview

Violeta · MirafloresAv. La Paz 1043, Lima
demos/location-message.tsx
import { LocationMessage } from "@/registry/whatsapp/location-message";
import { MessageBubble } from "@/registry/whatsapp/message-bubble";
import { MessageMeta } from "@/registry/whatsapp/message-meta";

export default function Demo() {
  return (
    <div className="flex flex-col gap-3">
      <MessageBubble
        direction="out"
        meta={
          <MessageMeta
            timestamp={new Date(2025, 0, 6, 18, 21)}
            status="delivered"
          />
        }
      >
        <LocationMessage
          latitude={-12.12094}
          longitude={-77.0305}
          name="Violeta · Miraflores"
          address="Av. La Paz 1043, Lima"
        />
      </MessageBubble>

      <MessageBubble direction="in">
        <LocationMessage latitude={-12.0464} longitude={-77.0428} />
      </MessageBubble>
    </div>
  );
}

Props

Read from LocationMessageProps in the component source at build time.

LocationMessageProps
PropTypeDefault
latituderequirednumber—
longituderequirednumber—
addressstring—
classNamestring—
hrefstring—
namestring—
previewUrl

A static map image. Without one, a drawn placeholder stands in.

string—

Files

  • registry/whatsapp/location-message.tsx
  • registry/whatsapp/cn.ts
  • registry/whatsapp/whatsapp.css
  • LICENSE