Skip to content

compose-miuix-ui/miuix

Repository files navigation

Miuix

Miuix is a shared UI library for Compose Multiplatform.

Now Supported: Android / Desktop(JVM) / iOS / WasmJs / Js / macOS(Native).

This library is experimental, any API would be changed in the future without any notification.

License Maven Central

Web Example

JsCanvas Demo / WasmJs Demo

Start

kotlin {
    sourceSets {
        commonMain.dependencies {
            implementation("top.yukonga.miuix.kmp:miuix:<version>")
            // Other dependencies...
        }
        // Other sourceSets...
    }
    // Other configurations...
}

Usage

  • Direct colors: provide a color scheme to MiuixTheme(colors = ...), e.g. built-in lightColorScheme() / darkColorScheme().
@Composable
fun AppTheme(
    content: @Composable () -> Unit
) {
    val colors = if (isSystemInDarkTheme()) darkColorScheme() else lightColorScheme()
    return MiuixTheme(
        colors = colors,
        content = content
    )
}
  • Controller-based: control modes via ThemeController and enable Monet dynamic colors; pass keyColor to set a custom seed color.
@Composable
fun AppTheme(
    content: @Composable () -> Unit
) {
    val controller = remember {
        ThemeController(
            ColorSchemeMode.MonetSystem,
            keyColor = Color(0xFF3482FF)
        )
    }
    return MiuixTheme(
        controller = controller,
        content = content
    )
}

Screenshot

screenshot-001 screenshot-002 screenshot-003
screenshot-004 screenshot-005 screenshot-006

Packages

 
 
 

Contributors 18

Languages