ui/widgets
library
Functions
button (String label , {bool primary = false , bool loading = false , bool disabled = false , String ? className , String ? ariaLabel , void onClick ()? })
→ HTMLButtonElement
A primary or secondary button. When loading it shows a spinner and is
disabled.
checkbox (String label , {required String id , bool checked = false })
→ ({HTMLInputElement box , HTMLElement root } )
A checkbox with a label.
emptyState (String message )
→ HTMLElement
A centered empty-state message.
errorBanner (AppError error )
→ HTMLElement
An error banner rendering error's message and optional recovery hint.
field (String label , HTMLElement input , {String ? hint })
→ HTMLElement
A labelled form field wrapping input, with an optional hint.
input ({required String id , String type = 'text' , String ? value , String ? placeholder , String ? autocomplete , String ? autocapitalize , void onEnter ()? })
→ HTMLInputElement
A text/password/url/number input. Returns the element so callers can read
.value.
loadingRow ([String ? label ])
→ HTMLElement
A spinner row with an optional label, for inline loading states.
radioGroup ({required String name , required List <({String label , String value } ) > options , required String selected , required void onChange (String value ), bool inline = false , String ? ariaLabel })
→ HTMLElement
A radio-button group. Each option is a (value, label) pair; selected is
the initially-checked value and onChange fires with the newly-picked value.
Set inline to lay the options out in a row (e.g. a segmented control), and
ariaLabel to name the group for assistive tech.
statusBadge ({required bool online })
→ HTMLElement
A small online/offline status pill.