Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-approval-request.json --yes

Approval request

Pro

An AI agent's request for a person's yes before it acts, with Approve and Deny, showing the decision once made, for React and Tailwind CSS. Part of Goop Pro.

When to use

  • An AI agent's request for a person's yes before it acts, with Approve and Deny, showing the decision once made.

Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Approval request on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.

Terminal
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-approval-request.json --yes
PROMPT
Add the Goop Approval request to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import { useState } from 'react';
import { ApprovalRequest } from '@/components/ui/goop/approval-request';
import { CodeBlock } from '@/components/ui/goop/code-block';
import { ToolCall } from '@/components/ui/goop/tool-call';

function InviteApproval() {
  const call = { study: 'Diallo Dental', participants: 8, template: 'first-session' };
  const [approved, setApproved] = useState(false);
  return (
    <div className="flex w-96 flex-col gap-3">
      <ApprovalRequest
        title="Send the invite email to 8 participants"
        description="The agent wants to run send_invites."
        askReason
        onApprove={() => setApproved(true)}
      >
        <CodeBlock code={JSON.stringify(call, null, 2)} language="json" wrap />
      </ApprovalRequest>
      {approved ? <ToolCall name="send_invites" state="running" summary="Sending 8 emails" input={call} /> : null}
    </div>
  );
}
  • Fits: chat (its recipe).
  • In an agent's thread it stands where the run waits, under the message that led to it; its details are the call the agent would make: <CodeBlock code={json} language="json" wrap />, the same input a ToolCall shows once it ran.
  • width, corner: add no class for these.

API reference

Options
OptionTypeWhat it does
titlestringWhat the agent wants to do, as a sentence ("Send the invite email to 12 participants"); it names the request.
description?stringA line under it: which tool, or why the agent asks.
children?ReactNodeThe details of what it would do, in the card's sheet: a CodeBlock of the call, Properties, a list.
decision?'pending' | 'approved' | 'denied'The decision (controlled): pending asks, approved or denied shows the answer.
defaultDecision?'pending' | 'approved' | 'denied' = 'pending'The decision it starts with (uncontrolled).
reason?stringA denial's reason shown under "Denied" (controlled); uncontrolled, the reason typed in the reason step.
onApprove?() => voidCalled when Approve is pressed.
onDeny?(reason: string | undefined) => voidCalled when the request is denied, with the reason typed (trimmed), or undefined when none was given.
askReason?boolean = falseA press on Deny first opens an optional reason field, sent with the denial.
labels?Partial<ApprovalRequestLabels>The words it says, any of them replaced.
  • Types: ApprovalRequestLabels = { approve: string; deny: string; cancel: string; reason: string; reasonPlaceholder: string; pending: string; approved: string; denied: string }
  • data-slot values (to select a part by): approval-request, approval-request-message, approval-request-status

Keyboard

KeyWhat it does
TabMove from Deny to Approve (in the reason step: Cancel, Deny, then the field)
Enter SpaceOn Approve or Deny: decide, the decided line taking the focus and the decision said politely; with askReason, Deny first shows the optional reason field, focused
EnterIn the reason field: deny with the typed reason (Shift+Enter breaks the line)
EscapeIn the reason field: back to the question, the focus on Deny, nothing sent

Accessibility

  • The part itself answers the keys above.
  • focus-visible: the browser's own (:focus-visible): write nothing

Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

goop.so/themes/meadow/components/approval-request.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-approval-request.json --yes

Where would you like to start?

Free · now

The Goop plugin

A design system for your AI coding agent, so screen ten matches screen one.

/plugin marketplace add goop-so/skillsthen /plugin install goop@goopCodex, Cursor, ChatGPT, the Claude app and more: Connect Goop
FreePro

The components

Every part live, with its props, its keys and what an agent sees. Whole page and app templates, working with sample data.