expect-actual

Installation
SKILL.md

expect/actual Pattern for KMP

The expect/actual declaration is Kotlin's mechanism for writing platform-specific implementations while maintaining a shared API surface.

Core Concept

// shared/commonMain/kotlin/Platform.kt
expect class Platform() {
    val name: String
}

// shared/androidMain/kotlin/Platform.android.kt
actual class Platform {
    actual val name: String = "Android ${Build.VERSION.SDK_INT}"
}
Installs
26
GitHub Stars
64
First Seen
Feb 17, 2026
expect-actual — ahmed3elshaer/everything-claude-code-mobile