# Approval request

Review a proposed action, confirm its scope and approve or reject it.

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

## When to use

- Use it when a page needs review a proposed action, confirm its scope and approve or reject it.
- 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 request.

## 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 request

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

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

## Minimal example

```tsx
import"./components/ui/tidal.css";
import"./components/ui/approval-request.css";
import{TidalApprovalRequest}from"./components/ui/approval-request";
export default()=><div className="tidal-scope"><TidalApprovalRequest onApprove={() => {}} onReject={() => {}} title={"Demo"}/></div>;
```

## Structured props

- `TidalApprovalRequest.onApprove: (event: MouseEvent<HTMLButtonElement>) => void`: Callback invoked when the approve interaction is proposed.
- `TidalApprovalRequest.onReject: (event: MouseEvent<HTMLButtonElement>) => void`: Callback invoked when the reject interaction is proposed.
- `TidalApprovalRequest.title: ReactNode`: Required title value accepted by this exported component.
- `TidalApprovalRequest.approveButtonProps?: Omit<Omit<DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "type" | "children"> | undefined` (default {}): Optional approve button props value accepted by this exported component.
- `TidalApprovalRequest.approveLabel?: string | undefined` (default "Approve"): Optional approve label value accepted by this exported component.
- `TidalApprovalRequest.approveRef?: Ref<HTMLButtonElement> | undefined`: Optional approve ref value accepted by this exported component.
- `TidalApprovalRequest.children?: ReactNode`: Optional children value accepted by this exported component.
- `TidalApprovalRequest.confirmation?: TidalApprovalConfirmation | undefined`: Optional confirmation value accepted by this exported component.
- `TidalApprovalRequest.description?: ReactNode`: Optional description value accepted by this exported component.
- `TidalApprovalRequest.details?: ReadonlyArray<{ id: string; label: ReactNode; value: ReactNode; }> | undefined` (default []): Optional details value accepted by this exported component.
- `TidalApprovalRequest.disabled?: boolean | undefined` (default false): Optional disabled value accepted by this exported component.
- `TidalApprovalRequest.readOnly?: boolean | undefined` (default false): Optional read only value accepted by this exported component.
- `TidalApprovalRequest.rejectButtonProps?: Omit<Omit<DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "type" | "children"> | undefined` (default {}): Optional reject button props value accepted by this exported component.
- `TidalApprovalRequest.rejectLabel?: string | undefined` (default "Reject"): Optional reject label value accepted by this exported component.
- `TidalApprovalRequest.rejectRef?: Ref<HTMLButtonElement> | undefined`: Optional reject ref value accepted by this exported component.
- `TidalApprovalRequest.state?: TidalApprovalState | undefined` (default "pending"): Optional state value accepted by this exported component.
- `TidalApprovalRequest.statusNote?: ReactNode`: Optional status note value accepted by this exported component.

## Complete usage example

[Source](https://tidalui.com/examples/approval-request.tsx) | [Manifest](https://tidalui.com/examples/approval-request.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 { TidalApprovalRequest, type TidalApprovalState } from "./components/ui/approval-request";

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

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



const tidalExampleStyles = ".tidal-scope .approval-request-demo {\n  width: min(100%, 560px);\n  max-width: 560px;\n  min-width: 0;\n}\n.tidal-scope .approval-demo-reset {\n  display: block;\n  margin: 16px 0 0 auto;\n  min-height: 44px;\n  padding: 10px 14px;\n  border: 1px solid var(--t-border);\n  border-radius: 9px;\n  background: var(--t-surface);\n  color: var(--t-ink);\n  font: inherit;\n  font-size: 12px;\n}";

export function ApprovalRequestDemo() {
  const [state, setState] = useState<TidalApprovalState>("pending"),
    [text, setText] = useState("");
  return (
    <div className="approval-request-demo">
      <TidalApprovalRequest
        title="Export project report"
        description="Review the proposed export before allowing this action."
        details={[
          { id: "scope", label: "Includes", value: "3 selected projects" },
          { id: "format", label: "Format", value: "CSV file" },
          { id: "destination", label: "Destination", value: "Your downloads" },
        ]}
        state={state}
        confirmation={{ phrase: "EXPORT", value: text, onValueChange: setText }}
        onApprove={() => setState("approved")}
        onReject={() => setState("rejected")}
        statusNote={
          state === "approved"
            ? "Sample approved. No file was created."
            : state === "rejected"
              ? "Sample rejected. No action was taken."
              : "Awaiting your decision."
        }
      />
      <button
        className="approval-demo-reset"
        onClick={() => {
          setState("pending");
          setText("");
        }}
      >
        Reset sample
      </button>
    </div>
  );
}

export default function AgentExample() {
  return (
    <div className="tidal-scope" data-theme="light" dir="ltr">
      <style>{tidalExampleStyles}</style>
      <ApprovalRequestDemo />
    </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."],"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 state (pending, approving, rejecting, approved, rejected, expired), title, optional description, stable-id details, contextual children and statusNote. Optional exact typed confirmation is fully controlled by its phrase/value/onValueChange. Keep each phrase nonempty and reset its value for a new request. Native input and action props/refs preserve caller handlers and prevention. Optional disabled/readOnly block decisions, and handled/busy states disable the persistent buttons. Approval requires an exact phrase match when configured; rejection remains available independently. Status changes after an activated action recover focus to the persistent note if its button is disabled. Button types remain button even inside forms. The outer section is labelled by its title or explicit native label. Consumers own authorization, expiration, audit records, side effects and errors; this component never executes a proposed action.
