Getting Started
Components
Special Effects
Animations
Text Animations
Backgrounds
import { DottedMap } from "@/registry/magicui/dotted-map"
export function Component() {
return (
<div className="relative h-[500px] w-full overflow-hidden rounded-lg border">
<div className="to-background absolute inset-0 bg-radial from-transparent to-70%" />
<DottedMap
markers={[
{
lat: 40.7128,
lng: -74.006,
size: 0.5,
}, // New York
{
lat: 34.0522,
lng: -118.2437,
size: 0.5,
}, // Los Angeles
{
lat: 51.5074,
lng: -0.1278,
size: 0.5,
}, // London
{
lat: -33.8688,
lng: 151.2093,
size: 0.5,
}, // Sydney
]}
/>
</div>
)
}
Installation
pnpm dlx shadcn@latest add @magicui/dotted-map
Examples
Smaller Dots
import { DottedMap } from "@/registry/magicui/dotted-map"
export function Component() {
return (
<div className="relative h-[500px] w-full overflow-hidden rounded-lg border">
<DottedMap dotRadius={0.1} />
</div>
)
}
Usage
import { DottedMap } from "@/components/ui/dotted-map"
<div className="relative h-[400px] w-full overflow-hidden rounded-xl border">
<DottedMap />
</div>
Props
Prop | Type | Default | Description |
---|---|---|---|
width | number | 150 | Width of the SVG map. |
height | number | 75 | Height of the SVG map. |
mapSamples | number | 5500 | Number of sample points for map generation. |
markers | Marker[] | [] | Array of markers to display on the map. |
dotColor | string | undefined | Color of the map dots (uses currentColor if not set). |
markerColor | string | "#FF6900" | Color of the markers. |
dotRadius | number | 0.22 | Radius of the map dots. |
className | string | undefined | Additional class names applied to the SVG. |
style | React.CSSProperties | undefined | Inline styles merged into the SVG. |
Limited Time Offer
Ship Faster with Magic UI ProMagic UI Pro
Stop building from scratch.
Get 8 production-ready templates and 50+ premium components that your users will love.
Next.js 15 + TypeScript ready
Copy, paste, customize in minutes
Save 100+ hours of development