Anmoldeep Singh

MarkerPopup

Cards 414

About

Marker popups for rich location cards with labels, media, ratings, hours, and actions.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds MarkerPopup to your project and fits it to your theme.

Code

How MarkerPopup is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import {
  Map,
  MapMarker,
  MarkerContent,
  MarkerPopup,
} from "@/components/ui/mapcn-marker-popup";

const settings = {
  longitude: -122.4194,
  latitude: 37.7749,
  zoom: 11,
  showPopup: true,
};

export default function Demo(props: Partial<typeof settings>) {
  const s = { ...settings, ...props };

  return (
    <div className="h-screen w-screen">
      <Map
        viewport={{
          center: [s.longitude, s.latitude],
          zoom: s.zoom,
        }}
        onViewportChange={() => {}}
      >
        <MapMarker longitude={s.longitude} latitude={s.latitude}>
          <MarkerContent />
          {s.showPopup && (
            <MarkerPopup closeButton>
              <div className="space-y-1">
                <p className="text-sm font-medium">San Francisco</p>
                <p className="text-muted-foreground text-xs">
                  California, United States
                </p>
              </div>
            </MarkerPopup>
          )}
        </MapMarker>
      </Map>
    </div>
  );
}

Dependencies

More by Anmoldeep Singh

View all
  • MapArc

    MapArc

    284
  • Map

    Map

    257
  • MarkerTooltip

    MarkerTooltip

    206
  • LayerMarkers

    LayerMarkers

    134
  • MarkerLabel

    MarkerLabel

    110
  • MarkerContent

    MarkerContent

    82
  • MapMarker

    MapMarker

    80
  • MapControls

    MapControls

    55

More in Cards

View all
  • Course Design Cards

    Course Design Cards

    1.1K
  • Statistics Card 2

    Statistics Card 2

    269
  • Statistics Card 7

    Statistics Card 7

    295
  • Card

    Card

    56
  • Stats cards with links

    Stats cards with links

    86
  • Interactive Tech Stack Bento Grid with Hover Effects

    Interactive Tech Stack Bento Grid with Hover Effects

    102
  • The Item one

    The Item one

    3
  • Card Studio

    Card Studio

    36