Skip to content

HITL Card ​

A human-in-the-loop confirm card: a titled list of generation options with checkable rows and credit costs, a Cancel / confirm footer carrying the checked total, and a read-only receipt state once confirmed.

Examples ​

Confirm and receipt ​

moonbit
@sumi.hitl_card(
  title="Generate the following 5 drafts",
  items=plan,
  on_toggle=set_plan.map(i => c => flip_at(c, i)),
  on_cancel=emit(Dismiss),
  on_confirm=emit(ConfirmAll),
)
@sumi.hitl_card(title="Generated the following 3 drafts", items=done, confirmed=true)

API ​

hitl_card ​

NameTypeDefaultDescription
title *String—Header text (14/22 Medium)
items *Array[HitlItem]—HitlItem rows (controlled)
on_toggleEmit[Int]—Row click, emits the row index
confirmedBoolfalseRead-only receipt: no checkboxes or footer
on_cancelCmd—
on_confirmCmd—Primary button carrying the checked total
cancel_labelString"Cancel"
confirm_labelString"Generate All"
max_heightInt190List scroll cap in px (default 190)
aria_labelString—
idString—Element id
classString—Extra class names
attrsAttrs—Extra HTML attributes
styleArray[String][]Extra inline styles

HitlItem::new ​

One generation option.

NameTypeDefaultDescription
labelString—
costInt0Credit cost; shown when > 0
thumbnailsArray[String][]Reference thumbnails (one per modality)
checkedBooltrueChecked for the confirm run; unchecked rows sink (0.2 label, faded thumbs, hidden cost)

* required (labelled) parameter — everything else is optional.