Skip to content

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

Coworking Spaces Map Block for React

Seven Berlin coworking spaces on a live map whose rings show the desks free on the weekday picked in five cells under it, with a sortable list and a card.

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

Help people pick a desk for the day with this coworking spaces map for React with Base UI. Deskfern, a flexible-office network, has seven spaces in real Berlin neighbourhoods, from Moabit to Neukölln, on a live Map that follows your theme, light or dark, with Hauptbahnhof marked for anyone arriving by train. Five cells under the map, Monday 26 to Friday 30 October, are the control: each carries the network's free desks that day, and choosing one re-labels every space with its own free desks, inside a ring filled by the share of its desks that are free, or "Full" in a dashed ring. A list under the cells, sorted with a Native Select by distance from Hauptbahnhof, by day-pass price or by free desks, is the keyboard route to a space; choosing one, there or on the map, flies the camera to it and fills the card beside the list with its day pass, a Progress bar of free desks, its amenities in words and its hours. Built from Map, Native Select, Progress, Button and Guides. For coworking networks, office-booking apps and workplace teams.

FAQ

Where do the spaces come from, and what stays local?

From LINES at the top of the file: one line per space with its name, neighbourhood, longitude and latitude, desks, free desks Monday to Friday, day-pass price in cents, hours and amenities. The neighbourhoods and Hauptbahnhof are real; Deskfern, its spaces, desks and prices are invented. Nothing is booked or sent: choosing a day, a sort or a space only changes what the block shows, and only the map tiles are loaded, from CARTO over OpenStreetMap data.

What do the rings and numbers on the map mean?

The number is the desks a space has free on the chosen day, and the ring around it fills with the share of its desks that are free, as a CSS conic gradient set from --share. A space with none free shows "Full" in a dashed ring, so a full space is told by its edge and its word, not by colour. Each cell's total is the sum of every space's free desks that day.

How does the sort work?

orderOf orders the seven spaces by distance from Hauptbahnhof (as the crow flies), by day-pass price, or by free desks on the chosen day, most first. The rows hold their places and their contents change, so the list never changes height; with "Most desks free" the order follows the day.

How does the map fly to a space?

The block keeps one aim: every space and the station (CITY), or the chosen space. MapCamera frames it when the map starts and flies to each new one, at once when reduced motion is on. Pan and zoom freely in between; the map button frames all seven again.

Can I use it without a mouse?

Yes. The five days are buttons with a pressed state, the sort is a native select, every space in the list is a button that chooses it, and the zoom and frame-all buttons work from the keyboard; the map takes the arrow keys and plus and minus once focused. The rings on the map are a pointer shortcut to the same choice. A polite message gives the day's total and the chosen space's free desks once a choice settles.

How does it look on a phone?

The map comes first, then the five days in one row (the day and its total), then the sorted list and the chosen space's card. The page scrolls over the map; hold Ctrl or ⌘ to zoom it with the wheel, or use two fingers on a phone.