shadcn.io is an independent project built on shadcn/ui
On this page5 sections
Installation
Overview
Show renters what they can reach from the office, with this apartment finder map for React with Base UI. Stoopwell, a rentals site, puts ten homes in Chicago's real neighbourhoods, from the West Loop to Logan Square, on a live Map that follows your theme, each a pill with its monthly rent round a briefcase marker for your office in the Loop. A Slider sets the radius from 1 to 8 km and redraws a shaded circle on the streets, labelled out on the lake; once the hand rests, the camera frames the new circle. A bedrooms Toggle Group (Any, Studio, 1, 2 and 3 beds) shows how many homes of each size the circle holds and filters by one. Homes inside the circle and the filter are solid pills and rows in the list, nearest first, with rent, bedrooms, square feet, move-in date and distance; the rest turn to dashed pills and leave the list. Pressing a pill or a row marks the home and names it on the map. From tablet width the search card floats over the map; on a phone it docks under it and the list becomes a row of cards. Built from Map, Slider, Toggle Group and Guides. For rental sites, relocation services and employee housing pages.
FAQ
Where do the homes come from, and what stays local?
From LINES, one string per home: its neighbourhood, longitude and latitude, bedrooms, rent, square feet and move-in date. The neighbourhoods and their places are real; Stoopwell, the homes and the rents are invented. Nothing is searched, saved or sent: the only requests are the map's own tiles. Pressing a home only marks it; in your app, load listings for the radius and the bedrooms from your own service and make the row open the listing.
How is the distance measured?
As a straight line from the office to the home, with the haversine formula in kmFromOffice, not as a travel time. The circle is the same distance drawn as a polygon of 72 points (circleOf); every radius the slider can take, from 1 to 8 km in half-kilometre steps, has its circle and its corners worked out once when the module loads.
Why does the map move when I change the radius?
The camera's aim is the circle's corners. A moment after the slider rests, MapCamera flies to frame the new circle, or jumps there when reduced motion is on, so a drag doesn't send the map on a dozen flights. From tablet width it leaves room for the search card floating at the start of the map (the right in a right-to-left page). Your own pans and zooms stay until the radius changes again.
What do the numbers on the bedroom buttons mean?
Each counts the homes of that size inside the current circle, so they change as you move the slider; Any counts them all. Press one to keep only that size: the list shrinks to it and the other homes turn to dashed pills. A radius with nothing in it says so in the list's place, and the block keeps its height.
Can I use it without a mouse?
Yes. The slider takes the arrow keys and reads its value in kilometres, the bedrooms are one toggle group, and every home in the list is a button that marks it. The map's zoom buttons work from the keyboard, and the map itself takes the arrow keys, plus and minus once focused. A polite message gives the count and the nearest home once the controls settle.
How does it look on a phone?
The map comes first, then the search card: the slider, the bedroom counts and the homes as a row of cards you swipe sideways, nearest first. The row is one card high whatever the filter, so the page never jumps. Scrolling the page over the map scrolls the page; two fingers move the map.





