shadcn.io is an independent project built on shadcn/ui
On this page5 sections
Installation
Overview
See which reefs bleach as the sea warms, with this coral reefs map for React with Base UI. Atollwatch, a reef monitoring group, scores nine reefs from the Red Sea to the Coral Sea, each at its real place on a live Map that follows your theme, light or dark. A Toggle Group floating over the map picks a scenario (Today, +1, +2 or +3 degrees) and each reef's bleaching risk is set from its typed base and its sensitivity to each degree. Risk is told three ways: a ring of one, three or five pixels round the marker, the number out of 100 inside it, and the word (High, Medium, Low) in the list. Choosing a reef, on the map or in the list, flies the camera there and fills its card with the risk and the coral and fish species counts; the globe button frames all nine again. Three cells under the map count the reefs at each level ("4 of 9") and filter the list and the markers; the list holds its height and shows an empty state when a level has none. Built from Map, Toggle Group, Button, Empty and Guides. For marine charities, reef managers and climate dashboards.
FAQ
How is the risk worked out?
riskOf adds the reef's sensitivity for every degree of warming to its base index and stops at 100. High is 70 and over, Medium 40 to 69, Low under 40. The reefs and their places are real; the bases, sensitivities and species counts in LINES are invented for this demo.
How does the map fly to a reef?
The block keeps one aim: every reef (WORLD, the corners of their places) or the chosen one. MapCamera frames the aim when the map starts and flies to each new one, quickly or not at all when reduced motion is on. Pan and zoom freely in between; the globe button aims at every reef again.
How do the filter cells work?
Each of the three cells is a button with a pressed state: press one to show only the reefs at that level, press it again to clear. Reefs outside the filter shrink to small hollow dots on the map. The list keeps a hidden copy of all nine rows so its height never changes, and the empty state is reachable, for instance High at Today.
Can I use it without a mouse?
Yes. The scenarios are a toggle group, the filters and every reef in the list are buttons, and the zoom buttons work from the keyboard; the map itself takes the arrow keys and plus and minus once focused. The markers are a pointer shortcut to the same choice as the list. A polite message gives the counts and the chosen reef once the choice settles.



