Skip to Content
Components

Proposal card

A suggested change with confidence, alternatives and undo.

A proposal card is a change the agent proposes, posted in the thread. It shows a from value changing to the chosen option, a confidence meter that fills in a moment after the card appears and then follows the chosen option, and the other options behind an "other options" fold. Accept, Not now and Undo move it between open, accepted and dismissed. By default it sits flat in a chat thread; set bare to false to give it a card of its own.

Preview
Raise contrast on the secondary buttonPricing, frame 2 of 3
#C9CFD82.1 : 1
#5B64725.9 : 1
Confidence
0%

Usage

<!-- include core.css + proposal-card.css -->
<div class="dm-prx" data-dm="">
  <div class="dm-prx-h">
    <span class="dm-prx-ic"><!-- wand icon --></span>
    <div class="dm-prx-ht"><b>Raise contrast on the secondary button</b><span class="dm-muted">Pricing, frame 2 of 3</span></div>
  </div>
  <div class="dm-prx-diff">
    <div class="dm-prx-sw"><span class="dm-prx-c" style="background:#c9cfd8"></span><span class="dm-num">#C9CFD8</span><span class="dm-tag dm-bad">2.1 : 1</span></div>
    <span class="dm-prx-ar"><!-- arrow --></span>
    <div class="dm-prx-sw dm-prx-new"><span class="dm-prx-c" style="background:#5b6472"></span><span class="dm-num">#5B6472</span><span class="dm-tag dm-ok">5.9 : 1</span></div>
  </div>
  <!-- confidence meter, options fold, Accept / Not now -->
</div>

Properties

NameTypeDescription
titleReactNodeWhat the agent wants to change.
subtitleReactNodeWhere, like "Pricing, frame 2 of 3".
iconIconNameThe icon in the tile. Defaults to a wand.
fromProposalValueHow it is now — a swatch, its label and a tag.
optionsProposalOption[]The changes on offer, the agent's pick first.
value / defaultValuenumberIndex of the option shown as the change. Leave value out to let the list pick it.
onValueChange(index) => voidCalled when another option is chosen.
open / defaultOpenbooleanWhether the other options are listed. Leave open out to let the toggle open them.
onOpenChange(open) => voidCalled when the fold toggles.
status / defaultStatusopen | accepted | dismissedLeave status out to let Accept, Not now and Undo move it.
onStatusChange(status) => voidCalled when the status changes.
onAccept(option, index) => voidCalled with the chosen option when Accept is pressed.
onDismiss / onUndo() => voidCalled by Not now and Undo.
acceptedLabelstringShown once accepted, like "Applied to 3 buttons".
dismissedLabelstringShown once dismissed.
confidenceLabelstringLabel beside the confidence meter.
barebooleanSits flat in a chat thread (the default). Set false to give it a card of its own.

Theming

Works in light and dark (data-theme="dark") and in the Soft style (data-style="soft"). The diff chip, confidence meter and tags take their colours from the theme tokens — the current value reads as bad and the options as ok by default — and the icon tile uses the accent tint, so the card reads against the dark stage; in Soft the swatches, tile and pills are rounder.

On this page