ApprovalCard
Human-in-the-loop request: what the agent wants to do, risk level, details, Deny / Always allow / Allow once.
Code
import * as React from 'react';
import { ApprovalCard } from '@fruit-labs/design';
export default function Demo() {
return (
<div
style={{
maxWidth: 520,
}}
>
<ApprovalCard
title="Run a command in your terminal?"
description="The agent wants to install dependencies in /web."
detail="npm install @stripe/stripe-js"
risk="medium"
{...{
onApprove() {},
}}
{...{
onDeny() {},
}}
{...{
onAlwaysAllow() {},
}}
/>
</div>
);
}Install
From npm:
npm install @fruit-labs/design
import { ApprovalCard } from '@fruit-labs/design';Or copy the TypeScript source into your project:
npx shadcn@latest add https://design.fruitlabs.online/r/approval-card.jsonGuidelines
- Say exactly what will happen and where. Show the command or payload in
detail. - High risk uses a red frame and a red confirm; never auto-approve high risk.
Props
| Prop | Type | Required |
|---|---|---|
title | React.ReactNode | No |
description | React.ReactNode | No |
detail | string | No |
risk | 'low' | 'medium' | 'high' | No |
approveLabel | string | No |
denyLabel | string | No |
onApprove | () => void | No |
onDeny | () => void | No |
onAlwaysAllow | () => void | No |
className | string | No |