A modern framework for full stack web apps in Kotlin, built upon Compose HTML
翻訳待ち
Loading the full README.
Read the full README ↗Kobweb is an opinionated Kotlin framework for creating websites and web apps, built on top of Compose HTML and inspired by Next.js and Chakra UI.
@Page
@Composable
fun HomePage() {
Column(
Modifier.fillMaxWidth().whiteSpace(WhiteSpace.PreWrap).textAlign(TextAlign.Center),
horizontalAlignment = Alignment.CenterHorizontally
) {
var colorMode by ColorMode.currentState
Button(
onClick = { colorMode = colorMode.opposite },
Modifier.borderRadius(50.percent).padding(0.px).align(Alignment.End)
) {
// Includes support for Font Awesome icons
if (colorMode.isLight) FaMoon() else FaSun()
}
H1 {
Text("Welcome to Kobweb!")
}
Span {
Text("Create rich, dynamic web apps with ease, leveraging ")
Link("https://kotlinlang.org/", "Kotlin")
Text(" and ")
Link(
"https://github.com/JetBrains/compose-multiplatform/#compose-html",
"Compose HTML"
)
}
}
}
While Kobweb is still pre-1.0, it has been usable for a while now. It provides escape hatches to lower-level APIs, so you can accomplish anything even if Kobweb doesn't support it yet. Please consider starring the project to indicate interest, so we know we're creating something the community wants.
Our goal is to provide:
📚 You can find a detailed guide at https://kobweb.varabyte.com/docs
You can also check out my talk at KotlinConf '25 for a high-level overview of Kobweb. The talk showcases what Kobweb can do, introduces Compose HTML (which it builds on top of), and touches on a range of frontend and backend functionality. It is light on code but heavy on understanding the structure and capabilities of the framework.
Here's a demo where we create a Compose HTML project from scratch with Markdown support and live reloading, in under 10 seconds:
The first step is to get the Kobweb binary. You can install it, download it, and/or build it, so we'll include instructions for all these approaches.
Major thanks to aalmiray and helpermethod to helping me get these installation options working. Check out JReleaser if you ever need to do this in your own project!
OS: Mac and Linux
$ brew install varabyte/tap/kobweb
OS: Mac and Linux
Thanks a ton to Lilian Maulny (e_ψ_lon) for adding support for this target!
First, enable flakes. Create ~/.config/nix/nix.conf:
experimental-features = nix-command flakes
Then:
$ nix profile add github:varabyte/kobweb-cli-nix
[!TIP] For more options, as well as NixOS instructions, see the README at https://github.com/varabyte/kobweb-cli-nix.
OS: Windows
# Note: Adding buckets only has to be done once.
# Feel free to skip java if you already have it
> scoop bucket add java
> scoop install java/openjdk
# Install kobweb
> scoop bucket add varabyte https://github.com/varabyte/scoop-varabyte.git
> scoop install varabyte/kobweb
OS: Windows, Mac, and *nix
$ sdk install kobweb
Thanks a ton to aksh1618 for adding support for this target!
With an AUR helper, e.g.:
$ yay -S kobweb
$ paru -S kobweb
$ trizen -S kobweb
# etc.
Without an AUR helper:
$ git clone https://aur.archlinux.org/kobweb.git
$ cd kobweb
$ makepkg -si
This is the beginning of the README. Read the rest at the original. Read the full README ↗