Skip to content

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

Flight Tracker Map Block for Solid

One flight on a live map: the great circle from Amsterdam to San Francisco, a plane turned to its track, and a time scrubber over the altitude profile.

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

Show where one flight is and how it's flying, with this flight tracker map for Solid with Ark UI. Aerwick 604, an invented airline's flight from Amsterdam Schiphol to San Francisco International, flies the great circle between the two airports on a live Map that follows your theme, light or dark: the line bows north over Scotland, Iceland, Greenland and Hudson Bay, solid in the primary colour where it's flown and dashed where it's still to fly. The plane's marker is turned to its track, the great circle's bearing where it is, and a chip over the map says what it's over. Under the map a dock holds the flight's time: an altitude profile with a Slider over it, from take-off to landing in five-minute steps, and a Play button that flies it through and stops on landing. The time since take-off and the time to go sit beside it, and six cells read the flight at that minute: the departure, the altitude in feet and metres (climbing, level or descending), the ground speed in knots and km/h, the track in degrees and in words, the distance flown, and the arrival, each airport with its own local clock. The crosshair button keeps the camera on the plane. Built from Map, Slider, Button and Guides. For airline apps, travel itineraries, airport screens and anything that tracks one moving thing along a long route.

FAQ

How is the route drawn?

The route is the great circle, the shortest path on the sphere, between the two airports' real coordinates: alongAt interpolates between them on the sphere (spherical linear interpolation) and ROUTE takes 129 points along it. On a flat map the shortest path looks curved, which is why it climbs past the Arctic Circle over Greenland. What the plane is over comes from OVER_LINES, worked out once against Natural Earth's coasts and borders.

Where do the altitude, speed and position come from?

From the typed profile in PROFILE_LINES: a minute after take-off, an altitude in feet and a ground speed in knots, with a straight change between points (a climb, two step climbs, the descent). The miles flown are that speed summed over the time, and their share of the whole flight places the plane on the great circle, so a slower climb and a faster cruise show on the map. Aerwick, the times and the profile are invented; nothing is fetched but the map's tiles.

How does the plane point the right way?

MapMarker takes a rotation in degrees clockwise from north, and the block gives it the track: the bearing from where the plane is to a point just ahead on the great circle. The flat map keeps angles true on the ground, so the plane points along its line at every step, west-northwest over the Atlantic and south-southeast into California.

Can I use it without a mouse?

Yes. The slider takes the arrow keys (five minutes a step), Page Up and Page Down, Home and End, and says the time since take-off; Play and Pause, the zoom buttons and the follow toggle are buttons, and the map takes the arrow keys and plus and minus once focused. Every figure on the map is also in the cells, and a polite message reads the flight once the time rests, never while it plays.

What happens with reduced motion?

Play stays off and says so, and the slider still moves the flight a step at a time. The camera jumps instead of flying, and with Follow on it stays centred on the plane at every step.

How does it look on a phone?

The map comes first with the flight's chip over it, then the Play button and the scrubber with its two ends' times, then the six cells in three rows of two: the departure and the arrival first, then the altitude, the speed, the track and the distance.