A simple "Hello, World" application in Vaadin and Kotlin. Uses Vaadin Boot. Requires Java 17+.
This project can be used as a starting point to create your own Vaadin application. It has the necessary dependencies and files to get you started. Just clone this repo and start experimenting! Import it to the IDE of your choice as a Gradle project.
verticalLayout(classNames = "centered-content") {
textField("Your name")
button("Say hello") {
setPrimary(); addClickShortcut(Key.ENTER)
}
}
Uses Karibu-DSL Kotlin bindings for the Vaadin framework.
Note: this example project uses Gradle. For Maven-based example project please visit karibu-helloworld-application-maven.
View the online demo.
Please see the Vaadin Boot documentation on how you run, develop and package this Vaadin-Boot-based app.
- The DSL technique is used to allow you to nest your components in a structured code. This is provided by the Karibu-DSL library; please visit the Karibu-DSL home page for more information.
- The browserless testing is demonstrated in the MainViewTest.kt file. Please read Browserless Web Testing for more information.
- For more complex example which includes multiple pages, please see the Beverage Buddy Karibu-DSL example-v10 app. It is a port of the Vaadin official Java Beverage Buddy App Starter to Kotlin + Karibu DSL.
- For information on how to connect the UI to the database backend please visit Vaadin-on-Kotlin You can find a complete CRUD example at Vaadin-on-Kotlin vok-example-flow-sql2o.