Access Denied With Request Path
A permissions error naming the specific missing role and the path that was blocked, with a list of the people who can grant it (with portraits), and a Request access card on an image tile that swaps to a Requested confirmation state on click.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button, badge, avatar, avatar-initials, media-slot dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/access-denied-with-request-path.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/error/error37.tsx instead.
Usage
The file also exports error37Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.
import { Error37, error37Demo } from "@/components/blocks/error/error37"; export default function Page() { return <Error37 {...error37Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| eyebrow | string | "403" | Small uppercase label above the headline. |
| heading | string | "You don't have access" | Main headline. |
| description | string | none | Supporting copy under the headline; defaults to a sentence built from missingRole when omitted. |
| missingRole | string | none | Name of the role required to view the page. |
| requestedPath | string | "/admin/billing" | The path the visitor tried to reach, shown in a monospace chip. |
| grantors | Grantor[] | none | People who can grant the missing role, each with a portrait. |
| image | MediaSlotImage | none | Background image for the request-access tile. |
| requestLabel | string | "Request access" | Label for the request button before it's clicked. |
| requestedLabel | string | "Requested" | Badge label shown after the request is made. |
| className | string | none | Extra classes for the outer section element. |
Types
interface Grantor { name: string; role: string; avatar?: { src: string; alt: string }; }
Behavior notes
- "Request access" is real local client state: clicking it flips a boolean and swaps the button for a "Requested" badge, but no request is actually sent anywhere, there's no backend behind it.
- Each grantor's Avatar falls back to initials derived from their name when no portrait is supplied.
- The requested-path chip and the missing-role text are plain demo strings, not derived from a real route or permissions check.
More Error Blocks
View all →centered-404-message
Centered 404 Message
Minimal centered 404 with two CTAs and a divided row of popular page links.
404-with-site-search
404 With Site Search
404 screen with a working search box and a bordered list of suggested pages.
split-404-with-image
Split 404 With Image
Two-column 404 with the message on one side and a full-bleed photo that scales on hover on the other.
404-with-destination-cards
404 With Destination Cards
404 screen with a grid of icon destination cards plus fallback CTA buttons.
404-support-panel
404 Support Panel
Card-style 404 echoing the requested URL, with a real back button and a support/status link row.
inline-404-line
Inline 404 Line
The smallest possible 404: code and message on one divided line with one button underneath.