Mixins / foldkit-mixins-ui
Feedback and status
| Widget | What it does | State |
|---|---|---|
Alert | Inline live region (role="alert"/status) or page banner | Application |
Toast | Dismissible toast stack with actions and swipe | Small Model / Bundle |
Progress | Determinate, stacked, or indeterminate progress bar/ring | Stateless |
Meter | Scalar gauge (good, fair, poor) with threshold | Stateless |
Spinner | Animated loading wheel (ring, dots, bars, pulse) | Stateless |
Timer | Countdown or stopwatch driven by Effect's Clock | Small Model / Bundle |
- Alert. Use
layout: 'inline'(with optionalassertive) for dynamic feedback, orlayout: 'banner'(withlabel) for a staticsectionlandmark. Supportsactions,onDismiss(words.dismiss), andrecoveryPart(Focus after removal). - Progress and Meter.
Progresstakesvalueas anOption(Option.none()renders indeterminate) orProgressSections for stacked bars, plusbufferandsegments.Metercomputesdata-level(good|fair|poorviaMeter.levelOf) and supportsorientation: 'vertical'andsegments. - Spinner and Timer.
Spinnersetsrole="status"when givenlabelandaria-hiddenwithout one.Timerreads Effect'sClock(TestClock-compatible), exportsTimer.phase(model), and packages state inBundles.Timer.
Toast
The newest stand in front, spread out while the pointer or focus holds the stack, at
most max (3) showing; a held stack or a hidden page pauses every countdown, keeping
the time left; a swipe toward the edge past threshold dismisses one. A toast is
spoken in a polite region, an error in an assertive one, each toast a keyed child of
its own (the regions are not atomic), so one added beside another, or with the same
words, is still read by itself. A toast takes actions (each a { label, value }
that dismisses it and says its value in Acted) and a cancel (words for a button
that only dismisses it), drawn in an actions row before the close button. A toast
that is already leaving does not act again when an action is pressed. A promise toast
is show with type: 'loading', the work run as a Command, and settle on the
toast's id when its Message comes back; through Bundles.Toast the helpers return
no id, so read Toast.nextId(model) before show. words is { label, close }
(Toast.words); tone: 'invert' is the text's ink as the card, as Sonner's inverted
toasts. A payload toast that shows progress replaces what an entry holds with
ToastView.make(schema).revise(model, entryId, payload), keeping its place,
animation and dismissal timing; upstream has no such operation.
ToastView binds upstream's Toast.make for the payload and swaps in the
transcribed view; the dismiss control stays inside the consumer's entryToView, so it
is content, not a slot. Toast.keepFocus hands focus from a dismissed toast to a
neighbour (see Focus after removal).