KmpLibrary

SweetMeSoft KMP Library

A complete cross-platform library for Kotlin that provides advanced UI components, maps integration, and essential utilities for developing native applications on Android, iOS, and Desktop.

GitHub release License: MIT Kotlin Compose Documentation

Table of Contents

Features

Modules

The library is divided into three main modules:

KMPControls

Basic UI components and fundamental utilities.

KMPMaps

Specialized components for maps integration.

Library (Main)

Main library with advanced components and tools.

KMPTestApp

Example application that demonstrates the use of all libraries.

Installation

Gradle (Kotlin DSL)

Add the dependencies in your build.gradle.kts file:

commonMain.dependencies {
    // Main library
    implementation("com.sweetmesoft.kmpbase:kmpbase:2.0.1")
    
    // Basic controls
    implementation("com.sweetmesoft.kmpcontrols:kmpcontrols:2.0.1")
    
    // Map components
    implementation("com.sweetmesoft.kmpmaps:kmpmaps:2.0.1")
}

Version Configuration

In your libs.versions.toml file:

[versions]
sweetmesoft = "2.0.1"

[libraries]
sweetmesoft-library = { module = "com.sweetmesoft.kmpbase:kmpbase", version.ref = "sweetmesoft" }
sweetmesoft-kmpcontrols = { module = "com.sweetmesoft.kmpcontrols:kmpcontrols", version.ref = "sweetmesoft" }
sweetmesoft-kmpmaps = { module = "com.sweetmesoft.kmpmaps:kmpmaps", version.ref = "sweetmesoft" }

Requirements

Required Dependencies

// In your build.gradle.kts
commonMain.dependencies {
    implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.6.0")
    implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3")
    implementation("dev.icerock.moko:permissions:0.18.0")
    implementation("dev.icerock.moko:permissions-compose:0.18.0")
}

Quick Start

1. Add Dependencies

In your libs.versions.toml file:

[versions]
sweetmesoft = "2.0.1"

[libraries]
sweetmesoft-kmpcontrols = { module = "com.sweetmesoft.kmpcontrols:kmpcontrols", version.ref = "sweetmesoft" }
sweetmesoft-kmpmaps = { module = "com.sweetmesoft.kmpmaps:kmpmaps", version.ref = "sweetmesoft" }
sweetmesoft-library = { module = "com.sweetmesoft:library", version.ref = "sweetmesoft" }

In your build.gradle.kts:

commonMain.dependencies {
    implementation(libs.sweetmesoft.kmpcontrols)
    implementation(libs.sweetmesoft.kmpmaps)
    implementation(libs.sweetmesoft.library)
}

2. Use Components

import androidx.compose.runtime.*
import com.sweetmesoft.kmpcontrols.pickers.DatePicker
import com.sweetmesoft.kmpbase.controls.PasswordControl
import com.sweetmesoft.kmpmaps.MapComponent
import com.sweetmesoft.kmpmaps.controls.Coordinates

@Composable
fun MyApp() {
    var selectedDate by remember { mutableStateOf(Clock.System.now().toLocalDateTime(TimeZone.currentSystemDefault()).date) }
    var password by remember { mutableStateOf("") }
    
    Column {
        // Password control
        PasswordControl(
            value = password,
            onValueChange = { password = it },
            label = "Password"
        )
        
        // Date picker
        DatePicker(
            value = selectedDate,
            title = "Select Date",
            onSelectedDate = { selectedDate = it }
        )
        
        // Map component
        MapComponent(
            modifier = Modifier.fillMaxSize(),
            coordinates = Coordinates(40.7128, -74.0060)
        )
    }
}

Documentation

Complete Documentation

Visit our complete documentation on GitHub Pages

The documentation includes:

Documentation by Module

Module Description Documentation
KMPControls Basic UI components and utilities View Docs
KMPMaps Cross-platform maps integration View Docs
Library Advanced components and tools View Docs
KMPTestApp Example application and guides View Docs

Local Documentation

You can also access the documentation locally:

Project Configuration

Android

In your Android build.gradle.kts:

android {
    compileSdk = 36
    defaultConfig {
        minSdk = 28
        targetSdk = 36
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_11
        targetCompatibility = JavaVersion.VERSION_11
    }
}

iOS

Make sure you have the minimum deployment target configured:

iosX64()
iosArm64()
iosSimulatorArm64()

Customization

Custom Themes

@Composable
fun MyCustomTheme(content: @Composable () -> Unit) {
    MaterialTheme(
        colorScheme = lightColorScheme(
            primary = Color(0xFF6200EE),
            secondary = Color(0xFF03DAC6)
        )
    ) {
        content()
    }
}

Examples

The project includes a complete example application in the kmptestapp module that demonstrates:

To run the example application:

./gradlew :kmptestapp:run

Contributing

Contributions are welcome! We have a complete guide for contributors.

Read our Contributing Guide

Ways to Contribute

Quick Start for Contributors

# 1. Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/KmpLibrary.git
cd KmpLibrary

# 2. Create a branch for your feature
git checkout -b feature/my-new-feature

# 3. Install dependencies and build
./gradlew build

# 4. Run tests
./gradlew test

# 5. Test the example app
./gradlew :kmptestapp:installDebug

Code of Conduct

This project adheres to a code of conduct. By participating, you are expected to maintain a respectful and welcoming environment for everyone.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Authors

Documentation and Resources

Development

Community

Project Status

Aspect Status
Current Version Version
Status Status
Kotlin Kotlin
Compose Compose
Platforms Platforms
License License
Tests Tests
Documentation Docs

Roadmap


**Do you like SweetMeSoft KMP Library?** **[Give it a star on GitHub](https://github.com/SweetMeSoft/KmpLibrary)** • **[Explore Documentation](https://sweetmesoft.github.io/KmpLibrary)** • **[Get Started Now](#quick-start)** • **[Contribute](/KmpLibrary/CONTRIBUTING.md)**

Need help? Open an issue or contact the development team.