All of them follow the rules : value widgets return (new_value, changed),
buttons return bool, menus (index, ok). Click a name for the full argument list.
widget example texttext(s, .Caption, .Muted), text(title, ellipsis = true)iconicon(FOLDER, .Title)badgebadge("Neu", .Primary), badge("Online", .Success, dot = true)avataravatar(name)statstat("Umsatz", "1840 €", delta = "+4 %")progressprogress(v, color = c, thin = true)spinnerspinner()calloutif kiln.callout(.Danger, "Fehler") { ... }empty_stateif kiln.empty_state(title, text) { ... }imageimage(img)
widget example buttonbutton("OK"), button(kiln.ICON_MENU, .Ghost), button("Suchen", icon = kiln.ICON_SEARCH), button("Entfernen", .Ghost, tone = .Danger)chipchip("Offen", m.open)checkboxcheckbox(m.notify, "Benachrichtigungen")toggletoggle(m.dark, "Dunkel")radioradio(m.size, Size.Large, "Groß")sliderslider(m.v, 0, 100)text_fieldtext_field(m.s, "Name"), text_field(m.pw, "Passwort", password = true)
Choice widgets take either a slice of labels and return an index, or an enum-indexed array and
return the enum.
widget example tabstabs(m.tab, TAB_NAMES)segmentedsegmented(m.range, RANGES, fill = true)navnav(m.page, PAGES, collapsed = true)selectselect(m.i, OPTIONS[:])chipschips(m.i, LABELS[:])
Plus date math: date_add_days, date_add_months, date_diff, date_parse, date_format, …
see Dates .
widget example tabletable(m.sel, COLUMNS[:], rows)treetree(m.sel, nodes)
chart_color(i) gives the i-th categorical color of the theme.
widget example dialogif kiln.dialog("name", "Titel") { ... }drawerif kiln.drawer("nav") { ... }show / hideshow("name"), hide()menumenu(kiln.ICON_MORE, ITEMS[:])context_menucontext_menu(ITEMS[:]) after the itemtooltiptooltip("Strg+S") after the itemtoasttoast("Gespeichert", .Success)
A dialog, the way it is meant to be used:
if kiln . button ( " Löschen " , . Danger ) { kiln . show ( " confirm " )}
if kiln . dialog ( " confirm " , " Eintrag löschen? " ) {
kiln . text ( " Das kann nicht rückgängig gemacht werden. " )
if kiln . button ( " Abbrechen " , . Ghost ) { kiln . hide ()}
if kiln . button ( " Löschen " , . Danger ) { append ( out , Delete {} ); kiln . hide ()}
The “Komponenten” page of the example shows every widget once:
odin run example -collection:lib=. -define:START_PAGE=5