
Offers cross-platform UI elements and components, such as typography and layout tools, for creating mobile and desktop applications with consistent theming and customization.
A Kotlin Multiplatform Compose library containing useful UI elements and components for Android, JVM (Desktop), and iOS platforms.
MaleficComponents is built with Kotlin Multiplatform, providing seamless cross-platform support:
All core UI components are available across all platforms through the commonMain source set:
Heading1 through Heading6, Body1, Body2 with customizable colorsMaterialBox, BackgroundBox for themed containersBooleanSwitch for toggle functionalityColorType enum for consistent themingNavWindow - Desktop window wrapper with PreCompose integrationMaleficBox - Malefic theming integration (requires JVM-only theming library)Add the dependency to your build.gradle.kts:
dependencies {
implementation("xyz.malefic.compose:comps:1.2.1")
}kotlin {
sourceSets {
val commonMain by getting {
dependencies {
implementation("xyz.malefic.compose:comps:1.2.1")
}
}
}
}@Composable
fun MyApp() {
val switchState = remember { mutableStateOf(false) }
MaterialBox(colors = MaterialTheme.colors) {
Column {
Heading1("Welcome to MaleficComponents!")
Body1("Cross-platform UI components for Compose")
BooleanSwitch(state = switchState)
BackgroundBox {
Body1("This content has a background.")
}
}
}
}@Composable
fun DesktopApp() {
NavWindow(
onCloseRequest = { exitApplication() },
title = "My Desktop App"
) {
MyApp() // Your common composable
}
}The library follows Kotlin Multiplatform best practices:
src/
βββ commonMain/ # Shared code for all platforms
β βββ kotlin/
β βββ xyz/malefic/compose/comps/
β βββ box/ # Layout components
β βββ switch/ # Input components
β βββ text/ # Typography components
βββ jvmMain/ # JVM/Desktop specific code
β βββ kotlin/
β βββ xyz/malefic/compose/comps/
β βββ box/ # Desktop theming integration
β βββ precompose/ # Desktop window components
βββ androidMain/ # Android specific code (currently empty)
βββ iosMain/ # iOS specific code (currently empty)
MIT License - see LICENSE for details.
Contributions are welcome! Please ensure that any new components maintain cross-platform compatibility by placing shared code in commonMain and platform-specific implementations in their respective source sets.
A Kotlin Multiplatform Compose library containing useful UI elements and components for Android, JVM (Desktop), and iOS platforms.
MaleficComponents is built with Kotlin Multiplatform, providing seamless cross-platform support:
All core UI components are available across all platforms through the commonMain source set:
Heading1 through Heading6, Body1, Body2 with customizable colorsMaterialBox, BackgroundBox for themed containersBooleanSwitch for toggle functionalityColorType enum for consistent themingNavWindow - Desktop window wrapper with PreCompose integrationMaleficBox - Malefic theming integration (requires JVM-only theming library)Add the dependency to your build.gradle.kts:
dependencies {
implementation("xyz.malefic.compose:comps:1.2.1")
}kotlin {
sourceSets {
val commonMain by getting {
dependencies {
implementation("xyz.malefic.compose:comps:1.2.1")
}
}
}
}@Composable
fun MyApp() {
val switchState = remember { mutableStateOf(false) }
MaterialBox(colors = MaterialTheme.colors) {
Column {
Heading1("Welcome to MaleficComponents!")
Body1("Cross-platform UI components for Compose")
BooleanSwitch(state = switchState)
BackgroundBox {
Body1("This content has a background.")
}
}
}
}@Composable
fun DesktopApp() {
NavWindow(
onCloseRequest = { exitApplication() },
title = "My Desktop App"
) {
MyApp() // Your common composable
}
}The library follows Kotlin Multiplatform best practices:
src/
βββ commonMain/ # Shared code for all platforms
β βββ kotlin/
β βββ xyz/malefic/compose/comps/
β βββ box/ # Layout components
β βββ switch/ # Input components
β βββ text/ # Typography components
βββ jvmMain/ # JVM/Desktop specific code
β βββ kotlin/
β βββ xyz/malefic/compose/comps/
β βββ box/ # Desktop theming integration
β βββ precompose/ # Desktop window components
βββ androidMain/ # Android specific code (currently empty)
βββ iosMain/ # iOS specific code (currently empty)
MIT License - see LICENSE for details.
Contributions are welcome! Please ensure that any new components maintain cross-platform compatibility by placing shared code in commonMain and platform-specific implementations in their respective source sets.