Skip to main content
Version: v3.x

Popup with Marker

import { MapContainer, Marker, Popup, TileLayer } from 'react-leaflet'

const position = [51.505, -0.09]

function PopupExample() {
return (
<MapContainer center={position} zoom={13}>
<TileLayer
attribution='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
<Marker position={position}>
<Popup>
A pretty CSS3 popup. <br /> Easily customizable.
</Popup>
</Marker>
</MapContainer>
)
}