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.
- 🎨 Theme-aware — Automatically adapts to light/dark mode
- 🎯 Zero config — Works out of the box with sensible defaults
- 📦 shadcn-svelte compatible — Uses the same patterns and styling conventions
- 🗺️ MapLibre GL powered — Full access to MapLibre's powerful mapping capabilities
- 🧩 Composable — Build complex map UIs with simple, declarative components
- 📍 Markers & Popups — Rich marker system with popups, tooltips, and labels
- 🛤️ Routes — Draw routes and paths on your maps
- 🎮 Controls — Zoom, compass, locate, and fullscreen controls
- ⚡ Svelte 5 — Built with Svelte 5's runes for optimal reactivity
npx shadcn-svelte@latest add https://mapcn-svelte.vercel.app/r/map.jsonThis 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 paths
- Original React version: mapcn by Anmol Saini
- Svelte port: Marius Lang
- Built with MapLibre GL
- Styled with Tailwind CSS
- Compatible with shadcn-svelte
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License - see the LICENSE file for details.