Tool confirm card

Approval for any tool call: the call as a trace line, then a card with its parameters and deny or confirm.

No model needed

Install

npx ondai add tool-confirm-card

Usage

import { ToolConfirmCard } from '@/components/ondai/tool-confirm-card'

const agent = useToolAgent({ tools, meta: { sendEmail: { policy: 'ask', risk: 'high' } } })

<ToolConfirmCard pending={agent.pendingConfirmation} presentation="card" />
  • Works with provider-executed tool loops (Apple, Nano) because approval happens inside the tool's execute.

Customize

Every AI component takes the same look and customization props, so it fits your app rather than ours.

<ToolConfirmCard
  variant="pop"
  tint="#FF5A5F"
  size="lg"
  radius={12}
  icons={{ tool: Search, riskLow: null }}
  labels={{ wantsToRun: '…', riskLow: '…' }}
/>
PropWhat it does
variantThe look of the whole component: clean, minimal, glass, pop, candy, metal, shine
sizesm, md, lg; type, rows, icons and keys scale together
tintAny colour; the variant paints its keys, tiles and glow in it
radiusCorner radius of the container
iconsReplace any icon (a lucide component, an element, or null to hide it): tool, riskLow, riskMedium, riskHigh, edit, editDone, deny, confirm, done, error, denied
labelsEvery visible and spoken string; defaults are exported as toolConfirmCardLabels: wantsToRun, riskLow, riskMedium, riskHigh, edit, editDone, deny, confirm, failed, skipped, denied
SlotsDraw a part yourself: renderField, renderActions, renderStatus, renderEmpty
stylesStyle any named part

Variants

PropOptions
variantclean, minimal, glass, pop, candy, metal, shine
presentationcard, sheet, banner, inline
sizesm, md, lg

Fallback

When no provider is ready the component renders the unavailable state (AvailabilityGate copy) and, where a deterministic path exists, keeps working without the model.

Eval score

No model-driven fixtures for this component.

Files

Registry dependencies: button, sheet, shimmer-text, surface

npm dependencies: @ondai/core, @ondai/tokens, lucide-react-native, react-native-reanimated

On this page