Chapter 11

Widgets

Widget Usage
Label(ui, text, variant) Plain-text heading or paragraph. Variants: 'title' | 'subtitle' | 'body' | 'caption'. Wraps to width. Never interprets HTML.
StrengthMeter(ui) meter.update(secret) after each password change. Four animated segments plus a caption. Uses estimateStrength(), which reads character classes without creating strings.
Toast(ui) toast.show(message, 'info' | 'success' | 'error', ms = 4000). Bottom-centre, also announced to screen readers.
PrivacyScreen(ui, message?) Covers the app when the window loses focus or the tab is hidden; renders synchronously so OS app switchers capture the cover. privacy.enabled = false to pause.