Components
Display a plan title and summary with expand/collapse and an Approve action. State-driven (idle / pending). Self-contained port from 21st.dev Agent Elements without the Markdown dep — summary renders as plain prose.
npx shadcn@latest add https://21st.dev/r/21stdev/plan-toolLoading preview...
import { PlanTool } from "@/components/ui/plan-tool";
const plan = {
id: "plan-2",
title: "Gateway rollout",
summary:
"Plan approved and ready to execute. Enable rate limiting behind the feature flag for internal traffic. Validate metrics ingestion (latency, status codes, rejects). Ramp to 10%/50%/100% with monitoring. Confirm error budget impact and update docs.",
};
export default function Demo() {
return (
<div className="flex items-center justify-center w-full min-h-screen bg-background p-8 overflow-hidden">
<div className="w-full max-w-md">
<PlanTool state="idle" plan={plan} approved />
</div>
</div>
);
}