
Creates a realistic, visually appealing switch inspired by a popular meme, featuring light and shadow effects, and written entirely with Compose Multiplatform.
Realistic and fancy switch that is inspired by a popular meme about Designer vs. Developer
See an example on GitHub Pages (Works with Chrome, Chromium-based, and Firefox)
val version = "1.0.1"
// Common
implementation("com.akexorcist.kotlin.multiplatform:dayandnight:$version")
// Android
implementation("com.akexorcist.kotlin.multiplatform:dayandnight-android:$version")
// iOS
implementation("com.akexorcist.kotlin.multiplatform:dayandnight-iosx64:$version")
implementation("com.akexorcist.kotlin.multiplatform:dayandnight-iosarm64:$version")
implementation("com.akexorcist.kotlin.multiplatform:dayandnight-iossimulatorarm64:$version")
// Desktop
implementation("com.akexorcist.kotlin.multiplatform:dayandnight-desktop:$version")
// WebAssembly
implementation("com.akexorcist.kotlin.multiplatform:dayandnight-wasm-js:$version")var selected by remember { mutableStateOf(true) }
// Switch Only
DayAndNightSwitch(
modifier = Modifier,
selected = selected,
onSwitchToggle = { selected = !selected },
)
// With Container
DayAndNightContainer(
modifier = Modifier.fillMaxSize(),
selected = selected,
) {
DayAndNightSwitch(
modifier = Modifier.scale(2f),
selected = selected,
onSwitchToggle = { selected = !selected },
)
}gradlew desktopRun -DmainClass=MainKt --quiet
gradlew wasmJsBrowserDevelopmentRun
gradlew build commonizeNativeDistribution
./iosApp/iosApp.xcodeproj with XcodeIf you're curious about how I built this library
Realistic and fancy switch that is inspired by a popular meme about Designer vs. Developer
See an example on GitHub Pages (Works with Chrome, Chromium-based, and Firefox)
val version = "1.0.1"
// Common
implementation("com.akexorcist.kotlin.multiplatform:dayandnight:$version")
// Android
implementation("com.akexorcist.kotlin.multiplatform:dayandnight-android:$version")
// iOS
implementation("com.akexorcist.kotlin.multiplatform:dayandnight-iosx64:$version")
implementation("com.akexorcist.kotlin.multiplatform:dayandnight-iosarm64:$version")
implementation("com.akexorcist.kotlin.multiplatform:dayandnight-iossimulatorarm64:$version")
// Desktop
implementation("com.akexorcist.kotlin.multiplatform:dayandnight-desktop:$version")
// WebAssembly
implementation("com.akexorcist.kotlin.multiplatform:dayandnight-wasm-js:$version")var selected by remember { mutableStateOf(true) }
// Switch Only
DayAndNightSwitch(
modifier = Modifier,
selected = selected,
onSwitchToggle = { selected = !selected },
)
// With Container
DayAndNightContainer(
modifier = Modifier.fillMaxSize(),
selected = selected,
) {
DayAndNightSwitch(
modifier = Modifier.scale(2f),
selected = selected,
onSwitchToggle = { selected = !selected },
)
}gradlew desktopRun -DmainClass=MainKt --quiet
gradlew wasmJsBrowserDevelopmentRun
gradlew build commonizeNativeDistribution
./iosApp/iosApp.xcodeproj with XcodeIf you're curious about how I built this library