Skip to content

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

Hotel Finder Map Block for React

Hotel prices on a live map of Lisbon with a Search this area button that lists the hotels inside the view, a nights field with a taxed total and a sort.

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

Let travellers search the part of the city they are looking at, with this hotel finder map for React with Base UI. Lodgewell, a hotel search, shows twelve hotels in real Lisbon neighbourhoods, from Alfama and Chiado out to Belém and Parque das Nações, as price pills on a live Map that follows your theme. The list under the map holds the hotels in the area last searched, at first the old centre. Pan or zoom the map and a "Search this area" Button appears over it; pressing it reads the map's own bounds and lists the hotels inside them, while the pills outside fade. A nights Number Input from 1 to 7 turns each night into a total with a typed city tax, a Native Select sorts the list by price, rating or nearness to the middle of the area, and choosing a hotel, by its pill or its row, marks both. An area with no hotels shows an empty state in the same box. Built from Map, Number Input, Native Select, Button, Empty and Guides. For hotel search, travel planners and booking sites.

FAQ

How is the total worked out?

Each hotel has a price for a night in whole euros; the total adds the typed city tax for each night (CITY_TAX) and multiplies by the nights, from 1 to 7. Prices, ratings and the tax are invented sample data: in your app, ask your rates service for the dates and the room.

What is real, and what stays local?

The neighbourhoods are real; the hotels, their names, prices and ratings are invented, each placed at a point inside its neighbourhood rather than at an address. Nothing is searched over the network or booked: the only thing loaded is the map's tiles, and every search reads the map you are looking at.

Can I use it without a mouse?

Yes. The nights field takes the arrow keys and typing, the sort is a native select, and every hotel in the list is a button. Focus the map and the arrow keys pan it and plus and minus zoom it; the Search this area button then comes into the tab order over the map. A polite message says when the list is out of date and what a search found.

How does it look on a phone?

The nights, the sort and the count of hotels come first, then the map, then the list in a box of fixed height that scrolls. On a phone two fingers pan the map, so the page still scrolls over it, and the list's height never changes with a search.