• Stars
    star
    104
  • Rank 320,301 (Top 7 %)
  • Language
    Kotlin
  • License
    MIT License
  • Created almost 7 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Kotlin Vaadin extensions and DSL

Powered By Vaadin on Kotlin Join the chat at https://gitter.im/vaadin/vaadin-on-kotlin GitHub tag Maven Central CI

Karibu-DSL (Vaadin Kotlin Extensions)

This is a Kotlin extensions and DSL library for the Vaadin framework.

Need a button? Write button {}. Need a text field? Write textField {}. Need a layout? Write

verticalLayout {
    val nameField = textField("Your name") {}
    button("Click me") {
        setPrimary()
        onLeftClick { Notification.show("Hello, ${nameField.value}") }
    }
}

Build own components and views by composing existing components with layouts.

This library:

  • Allows you to create Vaadin UI designs in the structured code way; the idea behind the library is explained in the DSLs: Explained for Vaadin article. The general DSL idea is explained in Kotlin Type-Safe Builders.
  • Includes useful components like PopupButton and TabSheet
  • Contains additional useful methods which Vaadin lacks; see karibu-tools

Compatibility chart:

Vaadin Version Karibu DSL Version Min. Java Version Remarks
24+ 2.0.0+ 17
14-22 1.x 8
23 1.x 11
8 1.0.x 5 Read more below

Documentation/Tutorial

>>> Documentation + Tutorial <<<: Please read the Karibu-DSL Vaadin 14+ tutorial.

The origins of the word Karibu: it's a term for North American subspecies of the reindeer; that connects to Vaadin (which is a Finnish word for a female reindeer). A nice connotation comes from Swahili where Karibu means welcome.

Note: For Groovy Vaadin DSL please see the Vaadin Groovy Builder library.

Vaadin 8 Unsupported

Vaadin 8 is no longer supported starting from Karibu-DSL 1.1+. If you're still using Vaadin 8, please use Karibu-DSL 1.0.x. Please find the documentation for Karibu-DSL Vaadin 8 in the 1.0.x README.md. Also see Issue #35 for more details.

Why DSL?

Just compare the Kotlin-based CategoriesList with the original Java CategoriesList. Both render the Beverage Buddy: Categories page, yet with Kotlin DSL:

  • The UI structure is immediately visible
  • The code is more readable and much shorter and concise
  • You can more easily copy parts of the UI and paste it into your project

Supports Vaadin 14+.

Example Projects

Vaadin 24:

Vaadin 8 UITest / Component Palette

Back in the days there was a Vaadin 8 project called UITest (or Component Palette) which demoed all Vaadin 8 components along with all of ValoTheme styles. The project is no longer around officially, but there's a karibu-dsl fork of the project. To run it quickly, follow these steps:

git clone https://github.com/mvysny/karibu-dsl
cd karibu-dsl
git checkout 1.0.x
./gradlew clean build example-v8:appRun

You may need JDK 11 or JDK 8 to run the demo: JDK 17+ may or may not work.

License

Licensed under the MIT License.

Copyright (c) 2017-2020 Martin Vysny

All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Contributing / Developing

See Contributing.

More Repositories

1

vaadin-on-kotlin

Writing full-stack statically-typed web apps on JVM at its simplest
Kotlin
177
star
2

karibu-testing

Vaadin Server-Side Browserless Containerless Unit Testing
Kotlin
95
star
3

aedict

Original Aedict 2 source codes
Java
38
star
4

vaadin-kotlin-pwa

Vaadin Kotlin PWA - A Task List demo
Kotlin
24
star
5

vok-orm

Mapping rows from a SQL database to POJOs in its simplest form
Kotlin
22
star
6

gphoto2-java

Automatically exported from code.google.com/p/gphoto2-java
Java
22
star
7

dynatest

Simplest & Powerful Testing Framework For Kotlin. No annotations!
Kotlin
22
star
8

karibu-helloworld-application

Karibu-DSL HelloWorld application in Vaadin
Kotlin
21
star
9

beverage-buddy-vok

Simple Example Web Application for Vaadin Flow
Kotlin
19
star
10

slf4j-handroid

Android logging done right
Java
17
star
11

photocloud-frame-slideshow

Android Digital Photo Frame
13
star
12

vaadin-boot

Boots your Vaadin app in embedded Jetty from your main() method quickly and easily
Java
12
star
13

vaadin-quarkus

Vaadin 14 app running on Quarkus
Java
9
star
14

vaadin-boot-example-gradle

Vaadin with Embedded Jetty using Gradle
Java
8
star
15

vaadin14-boot-example-maven

Vaadin 14 npm with Embedded Jetty Demo using Maven
Java
7
star
16

vok-helloworld-app

A very simple Vaadin-on-Kotlin Vaadin 10 HelloWorld app which you start off when building your own apps
Kotlin
7
star
17

vok-security-demo

Vaadin-on-Kotlin Security Authentication + Authorization Demo for Vaadin
Kotlin
6
star
18

ktgpio-example-app

Kotlin/Native example app using ktgpio to turn GPIO Raspberry PI pins on and off
Kotlin
6
star
19

vaadin-coroutines-demo

A Kotlin Coroutines Demo for the Vaadin Web Framework
Kotlin
6
star
20

vok-helloworld-app-v8

A very simple Vaadin-on-Kotlin HelloWorld app which you start off when building your own apps
Kotlin
4
star
21

vaadin14-boot-example-gradle

Vaadin 14 npm+webpack with Embedded Jetty using Gradle
Java
4
star
22

karibu-tools

The Vaadin Missing Utilities
Kotlin
3
star
23

suckless-ascii-profiler

An embedded profiler which you start and stop at will, and it will dump the profiling info into the console
Kotlin
3
star
24

kotlin-unsigned-jvm

Utilities for working with unsigned values in Kotlin/JVM
Kotlin
3
star
25

bookstore-vok

A Bookstore Vaadin Example Ported to Vaadin-on-Kotlin
Kotlin
3
star
26

electricity-price-calculator

Kotlin
2
star
27

karibu8-helloworld-application

A very simple Vaadin 8 Karibu-DSL-based application
Kotlin
2
star
28

beverage-buddy-jooq

Simple Example Web Application for Vaadin Flow
Kotlin
2
star
29

karibu-migration

Aids migration from Vaadin 8 to Vaadin 14+
Kotlin
2
star
30

vaadin10-sqldataprovider-example

Demoes a SQLDataProvider and a Filter Bar for Vaadin 10 Grid
Java
2
star
31

failover-vaadin

A Vaadin Add-on which automatically performs browser-side fail-over. If the connection to the primary server is lost, the browser will automatically redirect itself to a fallback/spare server of your choosing.
Java
2
star
32

vaadin-groovy-builder

Building Vaadin UIs in Groovy pleasantly with DSL
Groovy
2
star
33

dialogheaderbar

Experimental Dialog Header Bar for Vaadin 14 Dialog
Java
2
star
34

ev-fi

Electric Vehicles in Finland
SCSS
1
star
35

karibu-helloworld-application-maven

Karibu-DSL HelloWorld application in Vaadin, Maven-based
Kotlin
1
star
36

vaadin-boot-example-maven

Vaadin 23 running in Embedded Jetty
Java
1
star
37

vaadin-loom

Toying with Project Loom and Vaadin
Java
1
star
38

solar-controller-client

Communicates with a solar controller (Renogy Rover) over RS232/USB and retrieves statistics
Kotlin
1
star
39

playwright-perftest-vaadin

Performance Testing Vaadin apps with Microsoft Playwright
Java
1
star
40

mvysny.github.io

The https://mvysny.github.io blog sources
SCSS
1
star
41

testbench-simplest-demo-14

The TestBench simplest demo for Vaadin 14, also uses Karibu-Testing
Java
1
star
42

vaadin-quarkus-skeleton-starter

A Vaadin Skeleton Starter app which runs Vaadin in Quarkus
Java
1
star
43

webmon

A tiny embeddable JVM monitoring tool
Java
1
star
44

shepherd

Build & run apps automatically
Shell
1
star
45

vaadin-simple-security

Very simple security framework for Vaadin
Java
1
star
46

dirutils

Android File and Directory utilities which do not suck
Java
1
star
47

shepherd-java-client

Vaadin Shepherd Java Client
Kotlin
1
star
48

vaadin8-sqldataprovider-example

Demoes a SQLDataProvider and a Filter Bar for Vaadin 8 Grid
Java
1
star