# Approval queue

Review and decide submitted requests from one filterable queue.

Access: pro. Category: Blocks. Kind: composite.

## When to use

- Use it when a page needs review and decide submitted requests from one filterable queue.
- Choose it inside an authenticated product surface when the host application owns routing, persistence, and service calls.

## Alternatives

- Choose empty-state instead when empty collections, search results and errors with a clear next action is the actual interface need, rather than approval queue.

## Setup for agents

Use React 19 and TypeScript. Initialize shadcn for your framework, then merge this exact entry into components.json:

```json
{
  "registries": {
    "@tidal-pro": {
      "url": "https://tidalui.com/r/pro/{name}.json",
      "headers": {
        "Authorization": "Bearer ${TIDALUI_TOKEN}"
      }
    }
  }
}
```

The namespace must be named **@tidal-pro** because transitive Pro dependencies use that namespace. Obtain an agent key from your active Pro account at https://tidalui.com/account. Keep TIDALUI_TOKEN in your local environment, never in components.json, client code, Git or logs.

```sh
export TIDALUI_TOKEN='your-private-agent-key'
npx shadcn@latest add @tidal-pro/waitlist-form
npx shadcn@latest add https://tidalui.com/r/tidal-button.json
```

Free command: `npx shadcn@latest add https://tidalui.com/r/<name>.json`.
Pro command: `npx shadcn@latest add @tidal-pro/<name>`.

Import the base stylesheet and every stylesheet listed on the installed item's metadata. For example:

```tsx
import "./components/ui/tidal.css";
import "./components/ui/hero-section.css";
// Place installed components inside this wrapper:
<div className="tidal-scope" data-theme="dark">...</div>
```

Omit data-theme for the default light theme. Put the attribute on the same tidal-scope element for dark mode. Every component installs the shared free tidal-base dependency. After upgrading, run `npx shadcn@latest add https://tidalui.com/r/tidal-base.json --overwrite` to receive current tokens. Review local modifications before overwriting.

Vite: Use React + TypeScript. Map @/* to ./src/* in paths and Vite resolve.alias. Import tidal.css and each component stylesheet in your application entry.

Next.js 15 App Router: Next.js App Router: import tidal.css and component CSS in app/layout.tsx. Interactive examples belong in a client component with "use client". Map @/* to ./* or ./src/* to match your project.

TypeScript 6: use paths without baseUrl:

```json
{
  "compilerOptions": {
    "paths": {
      "@/*": [
        "./src/*"
      ]
    }
  }
}
```

Pro registry requests are server/CLI-only. Use the same-origin account interface in a browser; cross-origin Authorization preflights are intentionally unsupported.


## Install Approval queue

```sh
npx shadcn@latest add @tidal-pro/approval-queue
```

Stylesheets: `components/ui/tidal.css`, `components/ui/approval-queue.css`.

## Minimal example

```tsx
import"./components/ui/tidal.css";
import"./components/ui/approval-queue.css";
import{TidalApprovalQueue}from"./components/ui/approval-queue";
export default()=><div className="tidal-scope"><TidalApprovalQueue onSelectionChange={() => {}} requests={[{id:"example",title:"Demo",requester:"value",submitted:"value",state:"pending"}]} selectedId={"example"}/></div>;
```

## Structured props

- `TidalApprovalQueue.onSelectionChange: (id: string, event: MouseEvent<HTMLButtonElement>) => void`: Callback invoked when the selection change interaction is proposed.
- `TidalApprovalQueue.requests: ReadonlyArray<TidalQueuedApproval>`: Required requests value accepted by this exported component.
- `TidalApprovalQueue.selectedId: string | null`: Required selected id value accepted by this exported component.
- `TidalApprovalQueue.description?: ReactNode`: Optional description value accepted by this exported component.
- `TidalApprovalQueue.disabled?: boolean | undefined` (default false): Optional disabled value accepted by this exported component.
- `TidalApprovalQueue.empty?: ReactNode` (default "No requests to review."): Optional empty value accepted by this exported component.
- `TidalApprovalQueue.filter?: TidalQueueFilter | undefined` (default "all"): Optional filter value accepted by this exported component.
- `TidalApprovalQueue.labels?: Partial<{ all: string; pending: string; resolved: string; list: string; details: string; review: string; select: string; noMatch: string; invalid: string; outside: string; }> | undefined`: Optional labels value accepted by this exported component.
- `TidalApprovalQueue.onDecision?: ((id: string, decision: "approve" | "reject", event: MouseEvent<HTMLButtonElement>) => void) | undefined`: Callback invoked when the decision interaction is proposed.
- `TidalApprovalQueue.onFilterChange?: ((filter: TidalQueueFilter, event: MouseEvent<HTMLButtonElement>) => void) | undefined`: Callback invoked when the filter change interaction is proposed.
- `TidalApprovalQueue.title?: ReactNode` (default "Approval queue"): Optional title value accepted by this exported component.

## Complete usage example

[Source](https://tidalui.com/examples/approval-queue.tsx) | [Manifest](https://tidalui.com/examples/approval-queue.json). Install the listed additional dependencies. Consumer fixture: TypeScript pass; Vite pass. This fixture check is distinct from the actual shadcn install receipt.

```tsx
"use client";

import "./components/ui/tidal.css";

import { useState } from "react";

import { TidalApprovalQueue, type TidalQueueFilter, type TidalQueuedApproval } from "./components/ui/approval-queue";

import type { TidalApprovalState } from "./components/ui/approval-request";

import "./components/ui/approval-queue.css";

import "./components/ui/approval-request.css";

import "./components/ui/status-badge.css";



const tidalExampleStyles = ".tidal-scope .approval-queue-demo {\n  width: 100%;\n  max-width: 1080px;\n  min-width: 0;\n}\n.tidal-scope .approval-queue-demo > p {\n  font-size: 11px;\n  line-height: 1.6;\n  text-align: center;\n  color: var(--t-muted);\n  margin: 12px 8px 0;\n}";

const originals: TidalQueuedApproval[] = [
  {
    id: "access",
    title: "Temporary workspace access",
    description: "A contractor needs read-only access for the design review.",
    requester: "Mira Chen",
    submitted: "12 minutes ago",
    state: "pending",
    details: [
      { id: "scope", label: "Access", value: "Read-only" },
      { id: "expires", label: "Expires", value: "October 22" },
      { id: "workspace", label: "Workspace", value: "Design team" },
    ],
  },
  {
    id: "export",
    title: "Customer data export",
    description: "A sample export request for an internal account review.",
    requester: "Jon Bell",
    submitted: "38 minutes ago",
    state: "pending",
    details: [
      { id: "format", label: "Format", value: "CSV" },
      { id: "records", label: "Records", value: "128 sample rows" },
    ],
  },
  {
    id: "publish",
    title: "Publish release notes",
    description: "Release-note text approved for the next sample version.",
    requester: "Sam Rivera",
    submitted: "1 hour ago",
    state: "approved",
    details: [{ id: "version", label: "Version", value: "v1.8.0" }],
  },
];

export function ApprovalQueueDemo() {
  const [states, setStates] = useState<Record<string, TidalApprovalState>>({}),
    [selected, setSelected] = useState<string | null>("access"),
    [filter, setFilter] = useState<TidalQueueFilter>("all"),
    [status, setStatus] = useState("Select a request to review.");
  return (
    <div className="approval-queue-demo">
      <TidalApprovalQueue
        title="Review requests"
        description="Workspace requests awaiting a decision."
        requests={originals.map((item) => ({
          ...item,
          state: states[item.id] ?? item.state,
        }))}
        selectedId={selected}
        onSelectionChange={setSelected}
        filter={filter}
        onFilterChange={setFilter}
        onDecision={(id, decision) => {
          setStates((current) => ({
            ...current,
            [id]: decision === "approve" ? "approved" : "rejected",
          }));
          setStatus(
            `${originals.find((item) => item.id === id)?.title} ${decision === "approve" ? "approved" : "rejected"} in this sample.`,
          );
        }}
      />
      <p role="status">{status}</p>
      <p>
        Local sample requests. No access, export or publication is executed.
      </p>
    </div>
  );
}

export default function AgentExample() {
  return (
    <div className="tidal-scope" data-theme="light" dir="ltr">
      <style>{tidalExampleStyles}</style>
      <ApprovalQueueDemo />
    </div>
  );
}

```

## Gotchas

- The host application owns data, validation, persistence, navigation, and service side effects described by this API.

## Theme and accessibility

{"tokens":["--t-accent","--t-border","--t-border-strong","--t-canvas","--t-danger","--t-display","--t-ease-out","--t-ease-spring","--t-faint","--t-font","--t-ink","--t-line","--t-muted","--t-primary","--t-primary-contrast","--t-radius-card","--t-radius-control","--t-radius-overlay","--t-radius-panel","--t-ring","--t-shadow-lg","--t-shadow-soft","--t-soft","--t-subtle","--t-surface","--t-wash"],"darkMode":true}

{"keyboard":["Tab and Shift+Tab follow the component's native focus order.","Arrow-key behavior follows the exported composite-control implementation."],"aria":"The component wires labels and relationships from consumer-provided visible text or ARIA props; preserve those labels in production.","notes":"Verify focus visibility, text alternatives, contrast, and reduced motion in the final composition."}

Consumer-owned requests with unique non-empty IDs, titles, exact requester/submission text, pending/approving/rejecting/approved/rejected/expired state, details and optional custom content. Controlled selection and optional all/pending/resolved filter retain consumer authority. A selected request outside the current filter remains visible with an explicit notice. Native selection buttons support props/ref, caller prevention and disabled normalization; the accepted Approval request owns decision-button behavior and focus after a decision. Optional request content can supply assignment and comment controls. Root section props/ref, fixed h2 queue heading with h3 request heading, localized labels, empty and unknown-selection states are supported. The component does not grant access, run exports, publish content, contact services or persist decisions. Consumers supply all authorization, confirmations and downstream effects. The demo changes only local sample requests.
