- For significant features or refactors, sketch a Plan first; keep it updated as you work.
- Default to
rgfor searching and keep edits ASCII unless the file already uses non-ASCII. - Run the component-specific checks below before handing work off; do not skip failing steps.
- Use Context7 to pull library/API docs when you touch unfamiliar Compose/Android/JVM/Js/WasmJs/Swift APIs or deps.
Miuix is a UI component library built with Compose Multiplatform.
- Supported Platforms: Android, iOS, Desktop (JVM), macOS, Web (Wasm/JS).
| Action | Command |
|---|---|
| Build Project | ./gradlew assemble |
| Run Tests | ./gradlew check |
| Check Formatting | ./gradlew spotlessCheck |
| Fix Formatting | ./gradlew spotlessApply |
| Run Android Demo | ./gradlew :example:android:installDebug |
| Run Desktop (JVM) Demo | ./gradlew :example:desktop:hotRunDesktop --auto |
| Run Web (WasmJs) Demo | ./gradlew :example:wasmJs:wasmJsBrowserRun |
| Run Web (Js) Demo | ./gradlew :example:js:jsBrowserDevelopmentRun |
| Run macOS (Native) Demo | ./gradlew :example:macos:runDebugExecutableMacosArm64 |
| Directory | Description |
|---|---|
miuix/ |
Core Library. Contains all UI components. |
miuix-icons/ |
Extended icon resources. |
miuix-navigation3-*/ |
Custom Navigation 3.0 implementation and adapters. |
example/ |
Demo Application. Multiplatform app to showcase and test components. |
docs/ |
Documentation site (VitePress). |
build-plugins/ |
Custom Gradle plugins for build logic reuse. |
gradle/ |
Version catalog (libs.versions.toml) and wrapper. |
Code is organized into source sets to maximize sharing while allowing platform-specific implementations:
commonMain: 99% of UI logic. Pure Compose code.androidMain: Android-specific implementations.skikoMain: Skiko-specific implementations.desktopMain: Desktop-specific implementations.jsMain/wasmJsMain: Web-specific implementations.iosMain/macosMain: Darwin-specific implementations.
The project uses a custom theming system found in miuix.kmp.theme. Components rely on MaterialKolor for dynamic color generation.
The project uses AndroidX Navigation 3 (alpha) ported to KMP. Key modules:
miuix-navigation3-ui: UI hosting logic.
- Plan: Define the API in
miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/. - Implement: Create the
@Composablefunction. UseModifieras the first optional argument. - Preview: Add a demo page in
example/shared/src/commonMain/kotlin/. - Register: Add the demo to
HomePage.ktin the example app. - Verify: Run the example app on at least Android and Desktop.
- Reproduce: Create a reproduction case in the
exampleapp. - Fix: Apply the fix in
miuix/. - Test: Verify the fix across platforms if the bug was platform-specific.
- Edit Markdown files in
docs/. - Run
npm run docs:devindocs/(if Node.js is available) or rely on PR previews.
Issue: CI fails due to formatting.
Fix: ALWAYS run ./gradlew spotlessApply before committing.
- Mirror existing history style:
<scope>: <summary>with a short lowercase scope tied to the touched area (e.g.,library,docs,example). Keep the summary concise, sentence case, and avoid trailing period. - For doc-related changes use
docs; for build-related changes usebuild; for code fixes usefix; for general dependency updates usefix(deps); for Gradle/build-tool dependency or configuration updates usechore(deps). - Keep subject lines brief (target ≤ 72 characters); briefly describe specific modifications in the body.
- If referencing a PR/issue, append
(#1234)at the end as seen in history. - Before committing, glance at recent
git log --onelineto stay consistent with current prefixes and capitalization used in this repo.