shadcn.io is an independent project built on shadcn/ui
On this page5 sections
Installation
Overview
See which streets have a lane you can trust, with this bike lanes map for React with Base UI. Cogwell, a city bike-share, maps nine lanes in central Paris, from Rue de Rivoli to Boulevard Saint-Germain, each drawn along its real street on a live Map that follows your theme, light or dark. The type of a lane is its line style, never a colour: protected lanes are solid, painted lanes dashed and bus lanes shared with bikes dotted. A multiple Toggle Group floating over the map shows or hides each type, and a hidden lane fades out where it is, so nothing else moves. Three cells under the map give each type's kilometres, its share of the network on a Progress bar and its lanes; pressing a lane, there or on the map, draws it in the accent colour, names it on the map and flies the camera to it, and the map button frames the whole network again. Six docks sit at real squares as small squares carrying their free bikes, and a row above the cells lists them in words. Built from Map, Toggle Group, Progress, Button and Guides. For bike-share operators, city planners, cycling campaigns and any network with more than one kind of line.
FAQ
Where do the lanes and their lengths come from, and what is fetched?
Each lane was traced once along its street with OSRM's bicycle profile, thinned, and stored in SPECS as longitude,latitude pairs; its length is the sum of the great-circle distances between them, so the cells, the rows and the labels read the same numbers. Nothing is fetched at run time except the map tiles, and nothing is reserved or sent. The streets and squares are real; the lane types Cogwell gives them, the docks and the bike counts are invented sample data.
What happens when I hide a lane type?
Its lines fade to nothing in place and stop answering the pointer, its cell says Hidden, and the docks, cells and rows stay exactly where they were. Hide all three and the map shows only the docks. Pressing a lane of a hidden type shows that type again, so a choice is never invisible.
How does choosing a lane work?
The block keeps one aim: the whole network, or the chosen lane's corners. MapCamera frames it with room for the bar and the controls, and flies there on each change, at once under reduced motion. The chosen lane is the one thing in the accent colour, drawn wider and raised over the others, with its name and length in a label at its middle. Press it again, or the map button, to frame the network.
How do I use my own lanes and docks?
Replace SPECS with your lanes (a name, a type and the line from your street centre lines or a routing service) and DOCKS with your stations and their live counts. A new type is one more entry in KINDS: a label, a line width and its dashes, in line widths for the map and in pixels for the small samples.
Can I use it without a mouse?
Yes. The type toggles are a toggle group, every lane is a button in its type's list, and the zoom and network buttons work from the keyboard; the map itself takes the arrow keys and plus and minus once focused. The lines are a pointer shortcut to the same choice as the rows. A polite message gives the types and kilometres shown, and the chosen lane, once the choice settles.
How does it look on a phone?
The map comes first with the three toggles over it (their line samples drop out to fit), then the legend, the dock row wrapping onto a few lines, and the three type cells stacked, each with its lanes. Scrolling the page over the map scrolls the page; two fingers move the map.





