Skip to content

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

Trip Summary Card Map Block for React

A run's share card: the route on a live map of Paris, distance, time, pace and climb, splits as bars that light each kilometre, and Share and GPX buttons.

On this page5 sections

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

Sum up a run in one card people want to share, with this trip summary card map for React with Base UI. Paceward, a running app, shows a morning loop along the Seine, out on the left bank to the Pont Neuf and back on the right, on a small live Map that follows your theme and frames the whole route, the start and finish flagged at the Pont d'Iéna. Four cells under the map give the distance, measured along the route as drawn, the moving time, the average pace and the metres climbed. The splits sit under them as a bar chart, one bar a kilometre and taller for faster, with a line at the average: press a bar and that kilometre lights up on the map while the rest of the route fades, a marker shows where it ends, and the line above the chart reads its pace, climb and elapsed time; press it again, or Whole run, to see the loop. Share copies a one-line summary to paste anywhere, and Download GPX saves the route as a GPX file with a time on every point. Built from Map, Button, Badge and Guides. For running, cycling and hiking apps, fitness dashboards and any product that ends a trip with a summary.

FAQ

How are the distance, time and pace worked out?

The distance is the sum of the route's legs along the earth's curve, so it matches the line on the map. Each split has a typed pace in PACES; the time is each split's pace times its length, the last split being whatever is left after the whole kilometres, and the average pace is the moving time over the distance. The climb adds up the metres typed for each split in CLIMBS.

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

The loop was asked once of a public walking router while the block was written, simplified to about seventy points and typed into PATH; it follows real quays and bridges in Paris. Paceward, the runner and the paces are invented. The GPX file and the summary are built in the page; nothing is fetched or sent except the map's tiles.

What is in the GPX file?

A GPX 1.1 track named after the run, with every point of the route and the time the runner passed it: the start, 07:42 in Paris, plus the time the splits' paces give for the distance to that point. Apps such as watches, route planners and training logs read it as a run.

Can I use it without a mouse?

Yes. Every bar is a button with its kilometre, pace and climb as its name and a pressed state, so Tab and Enter walk the splits; Whole run, Download GPX and Share are buttons too. A polite message says which kilometre is lit, and when the summary has been copied.

What does Share do?

It copies a one-line summary, the title, distance, time, pace and climb, to the clipboard and turns into Copied for two seconds. Nothing is posted anywhere; in your app, point it at your share sheet or a link to the activity instead.

How does it look on a phone?

The card keeps its order: the title, the map, the four numbers in two rows, the splits chart across the full width, and the two buttons. Scrolling over the map scrolls the page; two fingers move the map.