Skip to content

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

Hospital Finder Map Block for React

Pick a need and an insurance plan to rank eight Seattle places of care by drive plus wait, on a live map with pills and the route to the one you choose.

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 find care they can be seen at soonest, with this hospital finder map for React with Base UI. Careholm, a care finder, puts eight places of care (four hospitals, two urgent-care centres and two clinics) in real Seattle neighbourhoods on a live Map that follows your theme, light or dark, with you in Capitol Hill. Four needs (Emergency, Urgent care, Cardiology, Children) are pressed cells that count the places offering each under the plan picked in a Native Select. The rail lists only the places that offer the need and take the plan, soonest first, where soonest is the drive from Capitol Hill plus the place's typical wait; on the map each place's pill shows that total and the others fade. Choosing a place, in the list or on the map, draws the road route to it and flies there, and the card under the list splits the time into the drive and the wait, with the hours and the plans taken. A plan nobody takes for a need shows an Empty state with a button back to any plan. Built from Map, Native Select, Empty, Button and Guides. For care directories, insurers and health-system sites.

FAQ

How is soonest worked out?

totalOf adds the drive in minutes to the place's typical wait for the need you picked, and the list sorts by that sum. So a nearby emergency room with a long queue can lose to one farther away: under Emergency, West Seattle's 16 minute drive and 40 minute wait beat Ravenna's 12 and 95.

Where do the drives and waits come from, and what stays local?

The drive times and routes were asked once, while the block was written, of the public OSRM demo over OpenStreetMap data, simplified and typed into ROUTE_LINES; the waits, plans and hours in PLACE_LINES are invented. Nothing is fetched at runtime but the map tiles, and nothing is searched, booked or sent; no location is asked for. In your app, route from the visitor's address on your server and show when each wait was measured.

Is this medical advice?

No. Careholm, the places' names, the plans and the waits are sample data, and the caption says so, with a line to call 911 in an emergency. Keep that line in your app, with your own region's number.

What happens when no place fits?

The count on each need follows the plan, so you can see a dead end before pressing it. Cardiology under Bronze HMO has no place: the list shows an empty state with a Show any plan button, every pill fades, and the map frames all eight places again.

Can I use it without a mouse?

Yes. The needs are buttons with a pressed state, the plan is a native select, and every place in the list is a button that draws its route; the zoom buttons and the frame button work from the keyboard, and the map takes the arrow keys and plus and minus once focused. The pills are a pointer shortcut to the same choice. A polite message gives the count and the chosen place's drive and wait once the choice settles.

How does it look on a phone?

The map comes first, then the needs as a two by two grid, the plan, the list and the card. The list keeps the height of its longest result (five rows, Children under any plan), so changing the need or the plan never moves the card under it.