UI Components
Pre-built interactive components for common patterns.
Modal
UI.Modal.create("confirm-modal")
.title("Confirm Action")
.body(p("Are you sure?"))
.footer(
button(onClick(UI.Modal.close("confirm-modal")), "Cancel"),
button(onClick(call("handleConfirm")), "Confirm")
)
.build()Tabs
Element overviewContent() { return div("Overview"); }
Element detailsContent() { return div("Details"); }
Element settingsContent() { return div("Settings"); }
UI.Tabs.create("main-tabs")
.tab("overview", "Overview", overviewContent())
.tab("details", "Details", detailsContent())
.tab("settings", "Settings", settingsContent())
.build()Dropdown
void editItem() {}
void deleteItem() {}
void openSettings() {}
UI.Dropdown.create("actions-menu")
.trigger("Actions")
.item("Edit", e -> editItem())
.item("Delete", e -> deleteItem())
.divider()
.item("Settings", e -> openSettings())
.build()Toast Notifications
// Setup in layout
Toast.setup()
// Actions to wire into a click handler
button(onClick(Toast.success("Saved successfully!")), "Save")
button(onClick(Toast.error("Something went wrong")), "Retry")
button(onClick(Toast.info("New message received")), "Notify")All UI components include keyboard navigation and ARIA accessibility.