shadcn.io is an independent project built on shadcn/ui
On this page5 sections
Installation
Overview
Let people see what is free before they head over, with this sports facilities map for React with Base UI. Hoopfield, a network of sports sites, puts eight sites in real Barcelona neighbourhoods and on two real beaches on a live Map that follows your theme, light or dark: two each for football, swimming, beach volleyball and climbing. A multi-select Toggle Group floating over the map picks the sports and the other pins fade. Each pin is its sport's icon with today's free slots in a bubble, and a full site wears a dashed ring. The band docked under the map lists the sites, the keyboard's way to the same choice as the pins, and holds the chosen site's slot grid for Monday 26 October: one row per hour from 15:00 to 21:00 and one column per pitch, lane, court or wall. A free slot is a button that holds it, a held one releases it, and a taken one is dashed and says Taken. Holding lowers the free count on the pin and in the list, and the line under the grid says what is held here. Built from Map, Toggle Group, Button, Empty and Guides. For sports centres, leisure trusts, clubs and any bookable space.
FAQ
Where do the free and taken slots come from?
Each site's line in SITE_LINES ends with one string per pitch, lane, court or wall, one letter per hour from 15:00: x is taken and . is free. freeOf counts the dots and takes away what you hold, so the pin, the list and the grid always agree. In your app, fill those strings from your booking system for the day shown.
Does holding a slot book it?
No. A hold is local state in this tab: it lowers the free counts and turns the slot into Held, and pressing it again, or Release, gives it back. Nothing is booked, sent or stored, and the line under the grid and a polite message both say so. Wire your own reservation call where hold sets the state.
What is real, and what stays local?
The neighbourhoods and the Bogatell and Barceloneta beaches are real places; Hoopfield, the sites' names and every slot are invented sample data. Nothing is fetched at runtime but the map tiles. "Today" is the fixed AS_OF date, so the block never reads the clock.
How does the sport filter work?
The toggle group can hold any mix of the four sports. Pins of the others fade to a quarter and drop their count, and their sites leave the list, which keeps its height; with no sport picked the list shows an empty state. Picking a faded pin turns its sport back on and opens that site's grid.
Can I use it without a mouse?
Yes. The sports are a toggle group, every site in the list is a button with a pressed state, and every free slot is a button whose name says the unit, the hour and what pressing it does; taken slots are text, so Tab skips them. The zoom buttons work from the keyboard, and the map takes the arrow keys and plus and minus once focused.





