Mixins / foldkit-mixins-ui

Feedback and status

WidgetWhat it doesState
AlertInline live region (role="alert"/status) or page bannerApplication
ToastDismissible toast stack with actions and swipeSmall Model / Bundle
ProgressDeterminate, stacked, or indeterminate progress bar/ringStateless
MeterScalar gauge (good, fair, poor) with thresholdStateless
SpinnerAnimated loading wheel (ring, dots, bars, pulse)Stateless
TimerCountdown or stopwatch driven by Effect's ClockSmall Model / Bundle
  • Alert. Use layout: 'inline' (with optional assertive) for dynamic feedback, or layout: 'banner' (with label) for a static section landmark. Supports actions, onDismiss (words.dismiss), and recoveryPart (Focus after removal).
  • Progress and Meter. Progress takes value as an Option (Option.none() renders indeterminate) or ProgressSections for stacked bars, plus buffer and segments. Meter computes data-level (good | fair | poor via Meter.levelOf) and supports orientation: 'vertical' and segments.
  • Spinner and Timer. Spinner sets role="status" when given label and aria-hidden without one. Timer reads Effect's Clock (TestClock-compatible), exports Timer.phase(model), and packages state in Bundles.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).