Skip to content

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

Calendar Linked Map Block for Ark UI

A live map beside a year calendar heat grid: press a day to see that day's cleanups on the map, or press a beach to light its days on the grid.

On this page5 sections

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

Link a year of dates to the places they happened, both ways, with this calendar linked map for React with Ark UI. Wracklog, a volunteer beach-cleaning network, logs its cleanups on ten Cornish beaches, from Bude to Sennen Cove, each at its real place on a live Map that follows your theme, light or dark. Beside the map, the whole of 2025 is a calendar of twelve small month grids, every day shaded in the chart ramp by the litter collected, from none to 100 kg and over, with a legend in kilos. Press a day, or move onto it with the arrow keys, and the map shows it: the beaches that held a cleanup become pills with the kilos collected, the rest stay hollow dots, and the band under both lists every beach with that day's kilos and volunteers. Press a beach, on the map or in the band, and the calendar lights only its days, on a scale for one beach, with its total for the year; press it again, or All beaches, to go back. It opens on the year's busiest day, the network's autumn weekend. Built from Map, Button and Guides. For volunteer networks, event programmes, field teams and any log of what happened where and when.

FAQ

Where do the cleanups come from?

They are invented. A small seeded generator in the file makes them once, at module scope: each beach's group has a usual weekday, more likely to go ahead in summer, the odd extra cleanup on another day, and an autumn weekend when every beach is out. The same year appears on every visit; nothing is fetched or saved, and the beaches and their places are real.

How are the calendar and the map linked?

The block keeps two choices: a day and a beach. The day drives the map and the band (which beaches held a cleanup that day, and how much they collected); the beach drives the calendar (only its days are shaded, against a scale for one beach: under 15 kg up to 45 kg and over). Both show at once, so you can pick a beach, then walk through its days and see who else was out.

Can I use the calendar from the keyboard?

Yes. The calendar is one tab stop: the arrow keys move a day or a week, Home and End go to the ends of the week, Page Up and Page Down move a month, and the day you land on is chosen. In a right-to-left page the left and right arrows swap. Every beach in the band is a button, the All beaches button clears the beach, and a polite message reads the chosen day once you stop.

What do the shades mean?

Each day is shaded by the kilos of litter collected: none, under 25, 25 to 49, 50 to 99, and 100 and over for the whole network, or under 15 up to 45 and over for one beach. The legend under the calendar says which scale is in use, and every day's button names its date, its cleanups and its kilos for screen readers. On a dark page the ramp turns round so the heaviest days stay the brightest.

How does it look on a phone?

The map comes first, then the calendar, whose months become a row you swipe sideways; it opens on the chosen day's month and follows the day you pick. The band of beaches sits in two columns under it. Scrolling the page over the map scrolls the page: two fingers pan the map, and the buttons in its corner zoom it.

Where do the map tiles come from?

From CARTO's free basemaps over OpenStreetMap data, loaded by MapLibre GL, the engine under the Map component, and drawn in your theme's colours; their credit stays in the map's corner. On a desktop, hold Ctrl or ⌘ and scroll to zoom.