shadcn.io is an independent project built on shadcn/ui
On this page5 sections
Installation
Overview
See how much of a city fits in your day, with this tourist attractions planner for React with Base UI. Sightwick, a travel guide, puts eight sights in central Lisbon, from the Praça do Comércio to the Castelo de São Jorge, at their real places on a live Map that follows your theme, each with a visit time. Ticking sights builds a plan, walked in the order of the list from your hotel in the Baixa: the map numbers the stops and draws the walk between them as a dotted line in the primary colour, along real streets and stairways, and each leg's minutes come from its length at 14 minutes a kilometre, for Lisbon's hills. A Slider sets the hours available from 3 to 10, and a Progress bar shows the time used, visits plus walking, with the limit marked on it; the line under it says "Fits with 1 h 44 min to spare" or "Over by 40 min", in words with an icon. On a wide screen the plan floats in a card over the map and the camera keeps every sight clear of it; on a phone the card docks under the map. Built from Map, Slider, Progress and Guides. For travel guides, city passes, shore days and any plan under a time budget.
FAQ
How is the time used worked out?
Each sight has a typed visit time in minutes. The plan is the ticked sights in the order of the list, and each stop's leg is the walking route from the stop before it, or from the hotel for the first. A leg's minutes are its length in metres over 1,000, times MINUTES_PER_KM (14), rounded to a minute; the time used is the visits plus the legs, and the limit is the slider's hours times 60. The bar is twelve hours long.
Where do the walking routes come from?
They are typed into the file. LEG_LINES holds one route for every pair of the hotel and the eight sights, 36 in all, each with its length, asked once from OSRM's foot profile over OpenStreetMap when the block was written and simplified to at most 22 points. The plan joins the legs it needs, so the block never calls a router; only the basemap's tiles are loaded.
Can a visitor change the order of the stops?
Not in this block: the order is the guide's walking order, and ticking a sight puts it in its place in that order. Each pair's route is stored one way, from the earlier sight to the later. To let visitors reorder stops in your app, store both directions or call your own router when the order changes.
What is real, and what stays local?
The sights and the streets are real; Sightwick, the hotel and the visit times are invented sample data. Nothing is booked, saved or sent. The basemap is CARTO's free tiles over OpenStreetMap data, loaded by MapLibre GL under the Map component, with their credit in the corner.
Can I use it without a mouse?
Yes. Every sight is a native checkbox in the list (Space ticks it), and the slider takes the arrow keys in half-hour steps. The numbered markers are a pointer shortcut to the same tick, and the map itself takes the arrow keys and plus and minus once focused. A polite message gives the stops, the time used and the verdict once the controls settle.





