Componentfeedback0.84 KB gzipZero dependencies
Permission Denied
Access denied panel with lock icon and request-access flow.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add permission-deniedOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { PermissionDenied } from "@/components/ui/permission-denied"; <PermissionDenied />Source code
permission-denied.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxpermission-denied.tsx50 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface PermissionDeniedProps extends React.HTMLAttributes<HTMLDivElement> { resource?: string; onRequestAccess?: () => void; requested?: boolean;} /** Permission denied state panel: lock icon + request access. */export function PermissionDenied({ resource = "this resource", onRequestAccess, requested, className, ...props }: PermissionDeniedProps) { const [sent, setSent] = React.useState(false); const isSent = requested ?? sent; return ( <div className={cn("flex w-full max-w-sm flex-col items-center gap-4 rounded-lg border border-dashed border-border p-8 text-center", className)} {...props}>Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { PermissionDenied } from "@/components/ui/permission-denied"; <PermissionDenied />| Prop | Type | Description |
|---|---|---|
| resource | string | Configures resource. (Default: "this resource") |
| onRequestAccess | () => void | Callback invoked on request access. |
| requested | boolean | Toggles requested. |