AI Agents Fancy Stable

RecommendationCard

.md

An agent's proposal awaiting an answer: a kicker, the recommendation, a confidence figure counted up beside a ring that fills to match, and two buttons that collapse into one quiet resolved line

Preview

Installation

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

Usage

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

<RecommendationCard />

Examples

Basic Usage

Props

PropTypeDefaultDescription
title *string-What the agent is proposing, e.g. "Add an index on orders.customer_id"
description string-Secondary muted line under the title — the reasoning, the expected effect
confidence number-How sure the agent is, from 0 to 1. Omitted, the whole confidence block disappears rather than reading as zero; out-of-range numbers are clamped and the band shifts colour at 0.75 and 0.5
acceptLabel string"Apply"Label for the confirm button
dismissLabel string"Dismiss"Label for the decline button
onAccept () => void-Called when the recommendation is accepted, after `state` has been written
onDismiss () => void-Called when the recommendation is dismissed, after `state` has been written
state "open" | "accepted" | "dismissed""open"Where the recommendation stands (bindable). Resolving swaps the buttons for a quiet line inside a polite live region; a resolved card refuses to resolve again
badge string-Small kicker above the title, e.g. "Suggestion"
sound booleanfalsePlays select on accept and close on dismiss, once the user has enabled sound

Slots

SlotDescription
childrenThe detail region between the header and the footer — a snippet of the change being proposed