Beautiful maps, made simple.
Free & open source map components for Svelte. Zero config, one command setup.
Built on MapLibre GL, styled with Tailwind, works seamlessly with shadcn-svelte.
This is a Svelte port of mapcn by Anmol. The original React version provides beautiful, composable map components for React applications. This port brings the same developer experience to Svelte 5, maintaining feature parity while adapting to Svelte's reactive paradigms.
npx shadcn-svelte@latest add https://mapcn-svelte.vercel.app/r/map.json
This will install maplibre-gl and add all map components to your project.
<script lang="ts">
import { Map, MapControls } from "$lib/components/ui/map";
</script>
<div class="h-[400px] w-full">
<Map center={[-74.006, 40.7128]} zoom={12}>
<MapControls />
</Map>
</div>
Full documentation is available at mapcn-svelte.vercel.app/docs
Map — Root map container with theme supportMapMarker — Place markers on the mapMarkerContent — Custom marker visualsMarkerPopup — Click-triggered popupsMarkerTooltip — Hover tooltipsMarkerLabel — Positioned labelsMapPopup — Standalone popupsMapControls — UI controls (zoom, compass, locate, fullscreen)MapRoute — Draw routes and pathsContributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)MIT License - see the LICENSE file for details.