AI Approval Flow in React
Try and install a React agent approval flow with a prompt, a reviewable diff, and explicit approve or reject states.
Last updated: December 3, 2026
Let an agent propose a change without applying it. Submit the sample prompt, review the proposed diff, then approve or reject it. This recipe runs entirely in the browser: it does not call a model or change a file.
Install the recipe
npx smoothui-cli add ai-approval-flowThe registry installs the recipe and its AI Prompt Input, AI Diff, and AI Approval dependencies. Use the installation guide if you have not set up a shadcn registry before.
import AIApprovalFlow from "@/components/smoothui/ai-approval-flow";
export default function Page() {
return <AIApprovalFlow />;
}Connect your agent
Replace the sample diff with the proposal from your backend. Show it before sending any mutation, keep rejection separate from an execution failure, and bind approval to that exact proposal. The UI shows the decision; your backend must enforce it.
For a complete conversation layout, see the Chat Template.