Silk Compose Save

Bringing Kotlin Compose UI to Minecraft

Project README

silk-compose

Silk Compose is a module for SilkMC which makes it possible to use Compose Multiplatform inside Minecraft, both on the server- and the client-side (the latter only planned).

Demo

https://user-images.githubusercontent.com/52456572/175792435-1a7f0e30-76cc-4739-87dc-0ec8ed222d4a.mp4

Dependency

Development Environment

Silk Compose is available on Maven Central.

modImplementation("net.silkmc:silk-compose:$version")

As a normal user

Download silk-compose from Modrinth to provide it at runtime and add it as a mod.

Usage

The docs are located at silkmc.net/silk-compose/docs.

To display a basic UI for a player, do the following:

player.displayComposable(8, 6) {
    YourComposableFunction()
}

@Composable
fun YourComposableFunction() {
    var clicks by mutableStateOf(0)
    Button(
        onClick = { clicks++ }
    ) {
        Text("Clicked $clicks times")
    }
}
Open Source Agenda is not affiliated with "Silk Compose" Project. README Source: SilkMC/silk-compose
Stars
63
Open Issues
2
Last Commit
3 weeks ago
Repository
License

Open Source Agenda Badge

Open Source Agenda Rating