# PermissionRequest

A request for specific access, with its scope and version shown.

- **Use it for**: A request for specific access with its scope and version.
- **Not for**: One-off action approvals. Try [ApprovalCard](https://unseenui.com/components/approval-card/), [ScopeGrant](https://unseenui.com/components/scope-grant/).

## Installation

```bash
npm install @stackunseen/ui
```

## Usage

```tsx
import { PermissionRequest } from '@stackunseen/ui';
import '@stackunseen/ui/styles.css';

<PermissionRequest variant="card" value={request} commandId={commandId} submission={submission} onDecision={sendDecision} onReconcile={lookupOriginal} />
```

## All props

| Prop | Type | Description |
| --- | --- | --- |
| `className` | `string` | Added to the root element, after the component's own classes. |
| `commandId` | `string` | Host-allocated idempotency identity; retain it with the submitted command. |
| `headingLevel` | `3 \| 2 \| 4 \| 5 \| 6` |  |
| `onDecision` (required) | `(allow: boolean) => void \| (command: PermissionDecisionCommand) => void` |  |
| `onReconcile` | `((original: PermissionDecisionCommand) => void)` | Lookup only. |
| `pending` | `boolean` |  |
| `reconciling` | `boolean` |  |
| `resource` (required) | `string` |  |
| `scopes` | `string[]` |  |
| `status` | `"denied" \| "revoked" \| "requested" \| "granted"` |  |
| `submission` | `PermissionSubmission` |  |
| `value` | `{ target: { scope: { workspaceId: string; threadId: string; runId: string; attemptId: string; streamId: string; schemaVersion: 2 \| 1; branchId?: string \| undefined; }; runVersion: number; requestId: …` |  |
| `variant` | `"compact" \| "card" \| "banner"` |  |

## Keyboard

Tab reaches controls; Enter or Space activates buttons. Accordions use arrow keys, Home and End. Select menus support arrows and typeahead; Escape closes menus and dialogs and restores focus.

## Works with

[ApprovalCard](https://unseenui.com/components/approval-card/), [ReviewChanges](https://unseenui.com/components/review-changes/), [DryRunPreview](https://unseenui.com/components/dry-run-preview/), [ApprovalBatch](https://unseenui.com/components/approval-batch/), [ScopeGrant](https://unseenui.com/components/scope-grant/), [AccessModeSelector](https://unseenui.com/components/access-mode-selector/), [ClarificationRequest](https://unseenui.com/components/clarification-request/)

Page: https://unseenui.com/components/permission-request/
