class NavTestView : View() { override val root = vbox { button("Goto View1") { setOnAction { Navigation.goto(View1::class) } } button("Goto View2") { setOnAction { Navigation.goto(View2::class) } } } } class View1 : View() { override val root = vbox { label("View1") } } class View2 : View() { override val root = vbox { label("View2") } } object Navigation { fun goto(type: KClass) { find(type).openModal() } } class NavTestApp : App(NavTestView::class)