shadcn.io is an independent project built on shadcn/ui
On this page5 sections
Installation
Overview
Read a city's air by pollutant, with this air quality map for React with Base UI. Aerowick, an air-quality network, reads nine stations in real Kraków neighbourhoods, from Bronowice in the west to Nowa Huta in the east, on a live Map that follows your theme, light or dark. A Toggle Group in the card floating over the map switches the pollutant between PM2.5, PM10, O₃ and NO₂, and every station is re-valued: its pill shows the reading in µg/m³ beside a swatch from the theme's chart colours for its band, Good, Fair, Moderate, Poor or Very poor. Each pollutant has its own limits, so the same number can sit in a different band for another gas. The card ranks the stations worst first, with the band in words, and names the worst in a sentence, for example "Highest PM2.5: Nowa Huta at 58 µg/m³, very poor." Choosing a station there or on the map flies the camera to it, and the legend under the map gives each band's range and how many stations are in it. Built from Map, Toggle Group, Button and Guides. For environmental agencies, city dashboards and public health teams.
FAQ
How are the five bands chosen?
Each pollutant has four limits in POLLUTANTS (cuts); a reading's band is the number of limits it reaches, so 0 is Good and 4 is Very poor. The legend's ranges and counts are read from the same limits, so they always match the swatches. The limits are a sample scheme made for this demo, not a health standard: use your regulator's table in your app.
Why does a station change band with the pollutant?
Particles and gases harm people at different levels, so each has its own scale. A reading of 60 µg/m³ is Very poor for PM2.5 and Fair for ozone here, which is why the toggle re-bands every station instead of re-colouring one shared scale.
How does the ranked list stay steady?
The card always holds nine rows, one per rank. Switching the pollutant changes which station sits at each rank and its reading, not the rows themselves, so nothing jumps and the card keeps its height. A tie keeps the stations' typed order.
Can I use it without a mouse?
Yes. The pollutant switch is a toggle group with arrow-key movement, every station in the ranked list is a button with its pressed state, and the zoom and frame buttons work from the keyboard; the map itself takes the arrow keys and plus and minus once focused. A polite message gives the worst reading and the chosen station once the choice settles.
What stays local in the demo, and how do I wire it up?
All of it. The stations, every reading and the limits are typed into the file; nothing is fetched apart from the map tiles, and nothing is published or saved. The neighbourhoods are real; Aerowick and its figures are invented. In your app load the latest readings from your network and keep bandOf and rankingOf, the only places a band and a rank are decided.





