nfrankel / kaadin

Kotlin DSL for Vaadin

Home Page:https://nfrankel.github.io/kaadin/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kaadin

Build Status Code coverage download

Kaadin is a library to create Vaadin Graphical User Interface using a Kotlin Domain-Specific Language .

1. Two-minutes tutorial

An example is worth a thousand words:

import ch.frankel.kaadin.* //(1)
import com.vaadin.server.*
import com.vaadin.ui.*

class FirstStepUI(): UI() {
    override fun init(request: VaadinRequest) {
        verticalLayout(margin = true, spacing = true) { //(2)
            label("Welcome to Vaadin") //(3)
        }
    }
}
  1. Import the namespace ch.frankel.kaadin.*

    1. There’s one Kaadin function for each Vaadin component e.g. button() maps Button()

  2. The topmost component will automatically be added as the UI content. There’s one such function per common Vaadin component.

  3. Nested blocks allow to add children components and configure them

2. Usage

  1. Build

    mvn install
  2. Use

    <dependency>
        <groupId>ch.frankel.kaadin</groupId>
        <artifactId>kaadin-core</artifactId>
        <version>0.1-SNAPSHOT</version>
    </dependency>

3. Going further

The full documentation is available on the Kaadin site.

4. License

Kaadin is distributed under the friendly Apache 2.0 License.

About

Kotlin DSL for Vaadin

https://nfrankel.github.io/kaadin/

License:Apache License 2.0


Languages

Language:Kotlin 99.5%Language:Shell 0.5%Language:HTML 0.0%