Skip to content

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

Analytics Card Map Block for Vue

A dashboard card of visits by city: a period toggle, three KPIs with their change, a live map of circles sized by visits, and a ranked list of cities.

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

Put a whole analytics view in one card, with this analytics card map for Vue with Ark UI. Visitwren, a web analytics tool, counts one site's visitors across fourteen European cities, from Lisbon to Warsaw, on a small live Map that follows your theme, light or dark. A Toggle Group in the card's head picks the period (7, 30 or 90 days), and everything moves with it: the three KPI cells (visitors, average visit and conversion) give each figure and its change on the period before, with an arrow and a sign rather than a colour; every city's circle grows or shrinks, its area following its visits; and the ranked list under the map re-orders, each row with its visits, its share and a bar against the top city. Hover a circle to read it in the map's corner; choose a city, by its circle or its row, to ring it and fly the map there, and the globe button frames all fourteen again. Built from Map, Toggle Group, Button and Guides. For analytics products, admin dashboards, marketing reports and any card that needs a where.

FAQ

How are the circles sized?

Each circle's area follows the city's visits in the period: its radius grows with the square root of the city's visits over the top city's, so twice the visits makes twice the area, not twice the width. The radius also grows a little as the map zooms in, so close cities don't merge when you look at the whole of Europe.

How are the KPIs and their changes worked out?

Visitors is the sum of the fourteen cities in the period; its change compares it with the period before, typed beside each period. The average visit changes in percent; conversion changes in percentage points, since it is a rate already. Every change shows an arrow and a sign as well as the number, so it reads without colour.

Where does the data come from, and what stays local?

Every figure is typed into LINES and PERIOD_LINES at the top of the file: the cities and their places are real; Visitwren, the site and the visits are invented. Nothing is fetched or saved except the map's tiles. In your app, fill the same shapes from your analytics endpoint for the chosen period.

Can I use it without a mouse?

Yes. The period is a toggle group, and every city in the ranked list is a button that rings it on the map and flies there, the same as pressing its circle. The zoom buttons and the globe button work from the keyboard, and the map takes the arrow keys and plus and minus once focused. A polite message gives the period's visitors and the chosen city's figures once the choice settles.

How does it look on a phone?

The card keeps its order: the period toggle, the three KPIs in one row (their comparison words move to screen readers), the map, then the cities in one column. On wider screens the list splits into two columns of seven.

Does the map take over the page's scrolling?

No. Scrolling over the map scrolls the page; hold Ctrl or ⌘ while scrolling to zoom it, or use two fingers on a phone. The tiles come from CARTO's free basemaps over OpenStreetMap data, with their credit in the map's corner.