shadcn.io is not affiliated with official shadcn/ui
Location Denied Error Block for React
A full-screen page for blocked location: type a town instead, nine towns filtered as you type, three stores and their distances beside a drawn map, and a Check again that reads the permission state.
Installation
Overview
Give people a way to carry on when location is blocked, with this location denied page for React with Base UI. It's the screen Findmark, a chain of stationery shops, shows in its store finder: the page's two side rails run its full height and one band crosses the screen between two rules with a plus mark where each meets a rail. The heading says "We can't see where you are". Under it an Input takes a town, nine invented towns are native radio rows filtered as you type with a polite count, and the Shine Button "Use this place" shows that town's three stores with their typed distances beside a framed, drawn greyscale map with a numbered pin for each. A "Check again" button asks the browser's permissions API for the location state and reports it, and a Collapsible folds away three steps for allowing location. On a phone the map and stores follow the form. It is the fallback for a refused location, not a map. For store finders, delivery, weather and any app that can ask where you are.
FAQ
What is real here, and what stays in the page?
Check again reads navigator.permissions.query for geolocation, which returns only a state ("granted", "denied", "prompt") and never a position. The page never asks for a position at all. The towns, streets, distances and map are invented and typed in TOWNS; pressing Use this place only changes what the page shows. In your app, search your own store data for the typed town (or geocode it on your server) and keep the numbered pins and list.
What does Check again say?
"Your browser says: location will ask" (or allowed, or blocked), followed by "Findmark never asked for your position". Some browsers keep that answer to themselves; then it says "won't say". It only reads: it does not open a prompt, and it does not change your browser's setting.
How does the town filter work?
Typing narrows the list as you go, ignoring case and accents, so "east" finds Eastmere, and a word that matches no town says so. The count is shown and also spoken once you pause typing, only when it changes. The list sits in a fixed-height box, so filtering never moves the buttons under it, and the towns are native radio buttons: Tab enters the list and the arrow keys move between towns.
Are the pins and distances measured?
No. Each store has a typed distance in kilometres and a typed bearing; the pin's place on the drawing is worked out from those two numbers so the drawing and the list agree, but the map is a sketch, not to scale, and not a real place. Swap the drawing for your map provider's component and keep the list.
Related
- Pro
Camera Denied Error
Browser and deviceA full-screen page for a blocked camera and microphone: what the app can use, a Check again that reads the permission state, a drawn address bar with its popover, and the steps for three browsers in tabs.
- Pro
Notification Denied Error
Browser and deviceA panel for blocked push notifications: two channel cells, Push (its state and the one-line fix, read from the browser) and Email instead, plus what the digest brings.
- Pro
Clipboard Denied Error
Browser and deviceA panel for when the browser blocks copying: a read-only box that selects itself, Select all text, a Copy button that really tries the clipboard, the keys as words for Mac or Windows, and steps to allow it.
- Pro
Geo Blocked Error
Blocked and limitedA full-screen 451 page for a title that is not licensed in the viewer's region: a tile map of six regions, solid where licensed and dashed where not, a Select that checks another region, and a collapsed note about VPNs.
- Pro
Role Ladder Permission Denied Error
Locked and removedA full-screen permission page for a design-system manager: a role ladder of four rising steps with you at Viewer and Admin marked as needed, 'Two roles up' in words, and a Request access dialog that records a note and an owner in local state.
- Pro
Offline Error
NetworkA full-screen offline page that listens to the browser's real online and offline events: a signal figure, a Check connection button, a Switch to pretend, and what stays available without a network.