AI Agents Fancy Stable

ApprovalCard

A human-in-the-loop gate before a side effect: the agent states what it is about to do, and the footer swaps its approve and deny buttons for a one-line verdict once someone decides

Preview

Installation

pnpm add fancy-ui-svelte
import { ApprovalCard } from 'fancy-ui-svelte'

Usage

svelte
<script lang="ts">
  import { ApprovalCard } from 'fancy-ui-svelte';
</script>

<ApprovalCard />

Examples

Basic Usage

Props

PropTypeDefaultDescription
title *string-What permission is being asked for, e.g. "Run database migration"
description string-Muted second line under the title — the consequence, the blast radius
state "pending" | "approved" | "denied""pending"Which side of the gate we are on (bindable). Buttons exist only while pending; writing a resolved value from outside settles the card without firing a callback
destructive booleanfalseMarks the action as irreversible: red approve button, a warning tint on the card, and an alert mark on the shield so the warning is not carried by colour alone
approveLabel string"Approve"Label for the approve button
denyLabel string"Deny"Label for the deny button
onApprove () => void-Called when approve is pressed, after state has been written
onDeny () => void-Called when deny is pressed, after state has been written
busy booleanfalseThe consumer is executing the decision: both buttons go disabled and the card is marked aria-busy

Slots

SlotDescription
childrenDetail region between the header and the footer — a diff, a command preview, the payload about to be posted