shadcn.io is not affiliated with official shadcn/ui
403 Forbidden Error Block for React
A full-screen 403 page for a team wiki: a door drawn as the zero of 403, the heading 'Ask someone who can say yes', the three workspace admins in a framed list with a Copy email button each, and a way back to the wiki.
Installation
Overview
Send people to someone who can open the door, with this 403 error page for React with Base UI. It's the error screen of Nooklane, a team wiki: a whole screen with the page's rails and one band across it, everything centred. The status code is display text with a door drawn in place of the zero, a keyhole and a handle in greyscale, over the heading "Ask someone who can say yes" and one sentence that says you're signed in but the Engineering handbook is for workspace admins. The three admins stand in a framed list ruled by Guides: an Avatar with initials, a name, an address, their role and when they were last active, and a Copy Button that writes the address to the clipboard. A Shine Button takes the visitor back to the wiki, and on a phone it is pinned to the foot of the screen. It's built from Avatar, Copy Button, Shine Button and Guides, with a CSS entrance only. For any app with roles.
FAQ
Does Copy email really copy, and what does it say?
Yes: it writes the admin's address to the clipboard, and a polite status line under the list says "Copied thessaly@nooklane.example. Nothing was sent." If the browser refuses (a page not served over HTTPS, or no permission) the line says so and asks you to select the address by hand. The button's own announcement is turned off so the page says it once. Nothing is emailed: the visitor pastes the address into their own mail.
Where do the admins come from?
From the typed constant ADMINS: a name, an address, initials and the last day each was active. "Active today", "Active yesterday" and "Active 5 days ago" are counted from the typed AS_OF date in UTC, never from the clock, so the page reads the same on the server and in every time zone. In your app, list the admins of the workspace the visitor tried to open, and think about whether each admin has agreed to be contacted this way; a short list of people who have is kinder than every admin there is.
What is the door, and is it accessible?
The "403" is decoration (hidden from assistive technology) and the door, drawn in place of the zero, is a small greyscale SVG with no focusable parts. The sentence under the heading says "Error 403" in words and says what is wrong, so nothing depends on the picture.
Does this return a 403 status to browsers and search engines?
No: a component can't. Send the real HTTP status from your server or framework, so crawlers, monitors and API clients see a 403 and not a 200 with an error drawn on it. Use 401 instead when the visitor isn't signed in at all.
Why is Back to the wiki pinned on a phone?
Because the list is tall on a small screen and the way out should stay in reach. The button sits in a foot that is sticky at the bottom of the screen below the small breakpoint and falls back into the flow from there up, so the page has the one coloured button in both layouts, never two.
Related
- Pro
401 Unauthorized Error
Sign-in and identityA full-screen 401 page for a reporting workspace: the heading, where the visitor was going, Sign in, and a framed list of other ways in where Single sign-on and Email me a link turn their own row into an email field in place.
- 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
Subscription Required Error
Plans and checkoutA full-screen 403 for a feature the plan does not include: the facts, what Pro adds, and an editable message that asks the workspace owners, with a Viewing as demo control that turns the ask into an upgrade with the price worked out.
- Pro
Read-Only Document Error
Locked and removedA full-screen read-only page for a document editor: a drawn page with a lock above a table of six actions (allowed or not, and the role each needs), Request edit access that opens a message to the owner in place, and Open in read mode.
- Pro
IP Address Blocked Error
Blocked and limitedA full-screen blocked-address page for a bot-protection layer: a review request form (organisation and reason) beside the evidence: the address with Copy, a five-part bar for 5 of 5 failed sign-ins in 10 minutes, the five attempts and when the block lifts.
- Pro
Account Deleted Error
Locked and removedA full-screen page for someone who signs in to a deleted account: three facts on shared hairlines and two choice cells that spell out what recovering and starting fresh each mean, with a Shine Button that follows the choice.