Skip to content

shadcn.io is an independent project built on shadcn/ui

Embed Builder Map Block for Vue

Set a map embed up (place, zoom, pin, theme, buttons) and copy the code written as you go. Pan the live preview or drag its pin and the code follows.

On this page5 sections
UI library: Ark UI

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Give people a map for their own site, with this embed builder map for Vue with Ark UI. Pinwright, a tool that writes map embeds, sets the preview and the code side by side: the preview is a live Map that follows your theme, and the settings beside it build both. A Native Select picks one of seven real places (Plaza Mayor in Madrid, Trafalgar Square, Nyhavn, Bryant Park, Shibuya Crossing and more), a Slider sets the zoom, a Switch and an Input give the pin and its label, and two Toggle Groups choose the theme (Auto or always Dark) and the map's buttons (zoom, compass, fullscreen). The code under the settings is written as you go, from the imports to the last control group: click the preview or drag the pin and its latitude and longitude change; pan, zoom or turn the map and the view in the code follows once it comes to rest. The lines each change wrote are marked and scrolled into the code's pane, and a Copy Button puts the whole snippet on your clipboard. Built from Map, Native Select, Slider, Switch, Input, Toggle Group, Copy Button and Guides. For store finders, contact pages, event sites and any find-us section.

FAQ

What code does it write?

A React component on the Map component's props, as codeOf builds it from the settings: MapView with an aria-label, its height, defaultViewport (the centre to four decimals, the zoom to one, and a bearing or pitch only when the preview is turned or tilted) and cooperativeGestures; a MapMarker with the pin's latitude and longitude to five decimals and an optional MapMarkerLabel; and MapControls with one group for the zoom buttons and one for the compass and fullscreen buttons. The imports list only the parts used. The Vue, Svelte and Solid Map take the same parts and props; change codeOf to write their syntax.

How does the code follow the preview?

The preview reports its view when it comes to rest (onViewportChangeEnd), and the code is written from that view, so whatever you see is what you copy. Choosing a place or a zoom aims the camera through MapCamera and flies there; a click on the map, or a drag of the pin, moves the pin. Each change keeps the code as it was, so the lines the change wrote are marked with a bar and scrolled into the code's own pane, never the page.

What happens when I copy, and what stays local?

Copy code writes the snippet to your clipboard and its icon turns to a check; where the browser refuses (a page not served over HTTPS, a denied permission) it shows a cross instead. Nothing is sent or saved: the settings live in the block's state, and the only requests are the map's tiles, from CARTO's free basemaps over OpenStreetMap data. The places are real; Pinwright is invented.

What does the Dark theme do?

It adds the dark class to the map's box, in the preview and in the code. The basemap, the pin, its label and the buttons then draw in your theme's dark tokens, on a light page too: the map sets its own text colour, so the buttons' icons follow. Auto leaves both out, and the map follows the page, light or dark.

Can I use it without a mouse?

Yes. The place is a native select, the zoom a slider (arrow keys, half a step at a time), the pin a switch and a text field, and the theme and buttons toggle groups. In the preview the pin is a draggable marker: focus it and the arrow keys move it 10 pixels, 40 with Shift. The code's pane takes focus so it scrolls from the keyboard, and a polite message says what the embed shows after each change.

How does it look on a phone?

The preview comes first, then the settings in one column, then the code in a pane with its own scroll, so long lines never widen the page. Scrolling the page over the preview scrolls the page: use two fingers to pan the map.