
Enables multiplatform library development with a sample app across desktop, Android, iOS, and web. Supports local and central Maven publishing with detailed setup instructions.
This repository is a ready-to-ship template for building and releasing Compose Multiplatform libraries. It automates the heavy lifting so you can focus on your API and UX:
/demo so users can try your library in the browser./api.New to this template? Check out the complete guide: 📖 Using This Template for Your Library
Quick setup:
Note: You don't need a pre-existing
<username>.github.iosite. GitHub Pages will automatically createhttps://<username>.github.io/<your-library-name>/when you run your first release.
For contributors: See CONTRIBUTING.md for development guidelines.
Add the dependency to your Kotlin Multiplatform library or app. Replace coordinates with your published group/artifact.
Option A — Version catalog (recommended)
gradle/libs.versions.toml:yourlib = "0.1.0"
[libraries]
yourlib = { module = "io.github.yourorg:your-lib", version.ref = "yourlib" }build.gradle.kts:kotlin {
sourceSets {
val commonMain by getting {
dependencies {
implementation(libs.yourlib)
}
}
}
}Option B — Hardcoded dependency (direct version) [versions]
kotlin {
sourceSets {
val commonMain by getting {
// From Maven Central release
// implementation("io.github.yourorg:your-lib:0.1.0-SNAPSHOT")
}
}
}
}If using snapshots from Maven Local, ensure:
repositories {
mavenLocal()
mavenCentral()
}Minimal usage example:
import fiblib.getFibonacciNumbers
val first10 = getFibonacciNumbers(10)
println(first10)Download and try the sample app on your platform without building from source:
| Platform | Download Link |
|---|---|
| 🍏 macOS (Intel) | |
| 🍎 macOS (Apple Silicon) | |
| 🪟 Windows | |
| 🤖 Android | |
| 🌐 Web (Wasm) | |
| iOS Simulator |
Option 1: Drag and Drop
Option 2: ADB Install
adb install sample-app-android-unsigned.apksample-app-wasm.zip
index.html in a web browserNote: You can also try the live demo without downloading: Try Live Demo
sample-app-ios-simulator.zip from the latest release
sample-app-ios-simulator.app
.app onto the Simulator window OR run:
xcrun simctl install booted /path/to/sample-app-ios-simulator.appDownload the DMG for your Mac architecture (Intel or Apple Silicon)
Open (mount) the DMG and drag the app to your Applications folder (or Desktop)
When you try to open the app for the first time, you may see a Gatekeeper warning:
Mac Gatekeeper dialog when opening the app for the first time
To allow running the app:
This is a normal security step for all open-source and CI-generated Mac executables. Apps are signed ad-hoc for internal/dev use, not with a public Apple developer ID.
Tip: Unsure about your Mac's type? Click the Apple logo → "About This Mac". If it says Intel, download x64; if it says M1, M2, or M3, download arm64.
This template automatically generates and deploys three key resources for your library:
All three are automatically deployed to GitHub Pages:
https://<username>.github.io/<library-name>/
https://<username>.github.io/<library-name>/api/
https://<username>.github.io/<library-name>/demo/
You can also run Gradle tasks in the terminal:
./gradlew run to run application./gradlew package to store native distribution into build/compose/binaries
./gradlew :sample:composeApp:run
sample/iosApp/iosApp.xcodeproj in Xcode and run the sample app./gradlew :sample:composeApp:wasmJsBrowserRun
The API documentation appearance has improved with Dokka 2.1.0-Beta. Below is a quick visual comparison.
| Dokka (2.0.0) | Dokka (2.1.0-Beta) |
|---|---|
![]() |
![]() |
![]() |
![]() |
This repo ships with an opinionated CI/CD that builds, tests, packages, releases, and deploys docs & demo automatically on tags.
flowchart TD
A["Lint"] --> B["Build & Test - Library + Sample (all targets)"]
B --> C["Android UI tests (emulator) & Maestro E2E tests(iOS & Android)"]
C --> D["Build artifacts - all targets APK • DMG • iOS Simulator zip • wasm bundle"]
D --> E["Create GitHub Release and upload artifacts"]
E --> F["Publish to Maven Central"]
E --> G["Deploy GitHub Pages README site (Docsify) + wasm demo + API docs"]Key points:
v*) and manual runs../gradlew :lib:publishToMavenLocal
~/.m2/repository/fiblib/
Follow https://www.jetbrains.com/help/kotlin-multiplatform-dev/multiplatform-publish-libraries.html & complete all necessary steps.
The above article focuses on publishing to MavenCentral. But if you want to verify publishing from your local machine, you can follow below steps:
~/.gradle/gradle.properties(not to be confused with gradle.properties in project root):
signing.keyId=XXXXXXXX
signing.password=[key password]
signing.secretKeyRingFile=../XXXXXXXX.gpg
mavenCentralUsername=[generated username]
mavenCentralPassword=[generated password]
For GPG_KEY_CONTENTS secret(signing.secretKeyRingFile above), can get plain text version of gpg key using below commands.
# This will print the private GPG key in plain text.
gpg --export-secret-keys --armor <key id>
# this will copy it for pasting in github actions secrets.
gpg --export-secret-keys --armor <key id> | pbcopy
./gradlew :lib:publishAndReleaseToMavenCentral --no-configuration-cache
Now check the deployments here https://central.sonatype.com/publishing/deployments
MIT License © 2025 aryapreetam and contributors. See LICENSE for details.
This template was built with inspiration and learnings from the excellent work of the Kotlin multiplatform community:
Project Setup: Initial project structure was created using Kotlin Multiplatform Web Wizard by terrakok
Inspirations:
Special thanks to:
This section lists planned improvements and features for the template. Contributions are welcome!
[ ] Add Detekt - Static code analysis for Kotlin
[ ] Add ktlint - Kotlin code formatter
[ ] Add Kover - Code coverage reporting
[ ] Add Dependabot - Automated dependency updates
[ ] Screenshot Testing - Visual regression testing
[ ] Performance Benchmarking - Track performance metrics
[ ] Multi-Module Support Guide
[ ] Compose Resources Guide
[ ] Video Tutorial
[ ] Blog Post / Article
[ ] Automated Changelog Generation
[ ] Version Bump Automation
[ ] Automated Screenshots
[ ] Linux Desktop Packaging
[ ] Additional Apple Platforms
[ ] Desktop Linux Native Build
[ ] Custom Domain Support
[ ] Improved Docsify Theme
[ ] Search Functionality
[ ] Vulnerability Scanning
[ ] SBOM Generation
[ ] Signed Releases
[ ] JitPack Support
[ ] NPM Package for Wasm
[ ] CocoaPods Support
If you have suggestions for improvements or want to contribute:
Priority: Items marked with 🔥 are high priority and would have the most impact.
See CONTRIBUTING.md for detailed contribution guidelines.
This repository is a ready-to-ship template for building and releasing Compose Multiplatform libraries. It automates the heavy lifting so you can focus on your API and UX:
/demo so users can try your library in the browser./api.New to this template? Check out the complete guide: 📖 Using This Template for Your Library
Quick setup:
Note: You don't need a pre-existing
<username>.github.iosite. GitHub Pages will automatically createhttps://<username>.github.io/<your-library-name>/when you run your first release.
For contributors: See CONTRIBUTING.md for development guidelines.
Add the dependency to your Kotlin Multiplatform library or app. Replace coordinates with your published group/artifact.
Option A — Version catalog (recommended)
gradle/libs.versions.toml:yourlib = "0.1.0"
[libraries]
yourlib = { module = "io.github.yourorg:your-lib", version.ref = "yourlib" }build.gradle.kts:kotlin {
sourceSets {
val commonMain by getting {
dependencies {
implementation(libs.yourlib)
}
}
}
}Option B — Hardcoded dependency (direct version) [versions]
kotlin {
sourceSets {
val commonMain by getting {
// From Maven Central release
// implementation("io.github.yourorg:your-lib:0.1.0-SNAPSHOT")
}
}
}
}If using snapshots from Maven Local, ensure:
repositories {
mavenLocal()
mavenCentral()
}Minimal usage example:
import fiblib.getFibonacciNumbers
val first10 = getFibonacciNumbers(10)
println(first10)Download and try the sample app on your platform without building from source:
| Platform | Download Link |
|---|---|
| 🍏 macOS (Intel) | |
| 🍎 macOS (Apple Silicon) | |
| 🪟 Windows | |
| 🤖 Android | |
| 🌐 Web (Wasm) | |
| iOS Simulator |
Option 1: Drag and Drop
Option 2: ADB Install
adb install sample-app-android-unsigned.apksample-app-wasm.zip
index.html in a web browserNote: You can also try the live demo without downloading: Try Live Demo
sample-app-ios-simulator.zip from the latest release
sample-app-ios-simulator.app
.app onto the Simulator window OR run:
xcrun simctl install booted /path/to/sample-app-ios-simulator.appDownload the DMG for your Mac architecture (Intel or Apple Silicon)
Open (mount) the DMG and drag the app to your Applications folder (or Desktop)
When you try to open the app for the first time, you may see a Gatekeeper warning:
Mac Gatekeeper dialog when opening the app for the first time
To allow running the app:
This is a normal security step for all open-source and CI-generated Mac executables. Apps are signed ad-hoc for internal/dev use, not with a public Apple developer ID.
Tip: Unsure about your Mac's type? Click the Apple logo → "About This Mac". If it says Intel, download x64; if it says M1, M2, or M3, download arm64.
This template automatically generates and deploys three key resources for your library:
All three are automatically deployed to GitHub Pages:
https://<username>.github.io/<library-name>/
https://<username>.github.io/<library-name>/api/
https://<username>.github.io/<library-name>/demo/
You can also run Gradle tasks in the terminal:
./gradlew run to run application./gradlew package to store native distribution into build/compose/binaries
./gradlew :sample:composeApp:run
sample/iosApp/iosApp.xcodeproj in Xcode and run the sample app./gradlew :sample:composeApp:wasmJsBrowserRun
The API documentation appearance has improved with Dokka 2.1.0-Beta. Below is a quick visual comparison.
| Dokka (2.0.0) | Dokka (2.1.0-Beta) |
|---|---|
![]() |
![]() |
![]() |
![]() |
This repo ships with an opinionated CI/CD that builds, tests, packages, releases, and deploys docs & demo automatically on tags.
flowchart TD
A["Lint"] --> B["Build & Test - Library + Sample (all targets)"]
B --> C["Android UI tests (emulator) & Maestro E2E tests(iOS & Android)"]
C --> D["Build artifacts - all targets APK • DMG • iOS Simulator zip • wasm bundle"]
D --> E["Create GitHub Release and upload artifacts"]
E --> F["Publish to Maven Central"]
E --> G["Deploy GitHub Pages README site (Docsify) + wasm demo + API docs"]Key points:
v*) and manual runs../gradlew :lib:publishToMavenLocal
~/.m2/repository/fiblib/
Follow https://www.jetbrains.com/help/kotlin-multiplatform-dev/multiplatform-publish-libraries.html & complete all necessary steps.
The above article focuses on publishing to MavenCentral. But if you want to verify publishing from your local machine, you can follow below steps:
~/.gradle/gradle.properties(not to be confused with gradle.properties in project root):
signing.keyId=XXXXXXXX
signing.password=[key password]
signing.secretKeyRingFile=../XXXXXXXX.gpg
mavenCentralUsername=[generated username]
mavenCentralPassword=[generated password]
For GPG_KEY_CONTENTS secret(signing.secretKeyRingFile above), can get plain text version of gpg key using below commands.
# This will print the private GPG key in plain text.
gpg --export-secret-keys --armor <key id>
# this will copy it for pasting in github actions secrets.
gpg --export-secret-keys --armor <key id> | pbcopy
./gradlew :lib:publishAndReleaseToMavenCentral --no-configuration-cache
Now check the deployments here https://central.sonatype.com/publishing/deployments
MIT License © 2025 aryapreetam and contributors. See LICENSE for details.
This template was built with inspiration and learnings from the excellent work of the Kotlin multiplatform community:
Project Setup: Initial project structure was created using Kotlin Multiplatform Web Wizard by terrakok
Inspirations:
Special thanks to:
This section lists planned improvements and features for the template. Contributions are welcome!
[ ] Add Detekt - Static code analysis for Kotlin
[ ] Add ktlint - Kotlin code formatter
[ ] Add Kover - Code coverage reporting
[ ] Add Dependabot - Automated dependency updates
[ ] Screenshot Testing - Visual regression testing
[ ] Performance Benchmarking - Track performance metrics
[ ] Multi-Module Support Guide
[ ] Compose Resources Guide
[ ] Video Tutorial
[ ] Blog Post / Article
[ ] Automated Changelog Generation
[ ] Version Bump Automation
[ ] Automated Screenshots
[ ] Linux Desktop Packaging
[ ] Additional Apple Platforms
[ ] Desktop Linux Native Build
[ ] Custom Domain Support
[ ] Improved Docsify Theme
[ ] Search Functionality
[ ] Vulnerability Scanning
[ ] SBOM Generation
[ ] Signed Releases
[ ] JitPack Support
[ ] NPM Package for Wasm
[ ] CocoaPods Support
If you have suggestions for improvements or want to contribute:
Priority: Items marked with 🔥 are high priority and would have the most impact.
See CONTRIBUTING.md for detailed contribution guidelines.