Skip to content

software-mansion/kmp-sharing

Repository files navigation

KMP Sharing by Software Mansion

Kotlin License Maven Central

Universal sharing function for Compose Multiplatform.

🎯 See It in Action

Check out the sample project in the /sample directory for complete usage examples.

Nagranie.z.ekranu.2025-11-3.o.12.17.19.2.mov

✨ Features

  • Cross-platform compatibility - Single API for both Android and iOS
  • Native performance - Uses Android Intent system and iOS UIActivityViewController
  • File sharing support - Share local files with proper MIME type detection
  • Customizable options - Platform-specific customization options
  • Compose integration - Built with Compose Multiplatform for modern UI development

🚀 Usage

@Composable
fun ShareButton() {
    val share = rememberShare()

    Button(
        onClick = {
            share(
                data = "file:///path/to/your/file.jpg",
                options = SharingOptions(
                    android = AndroidSharingOptions(
                        dialogTitle = "Share Image",
                        mimeType = "image/jpeg"
                    ),
                    ios = IosSharingOptions(
                        anchor = Anchor(x = 100f, y = 100f, width = 200f, height = 50f)
                    )
                )
            )
        }
    ) {
        Text("Share")
    }
}

📦 Installation

For installation instructions visit our dedicated document.

📚 API Reference

Check out our dedicated documentation page for the API reference.

🤝 Contributing

We welcome contributions! Please feel free to submit a pull request.

KMP Sharing is created by Software Mansion

swm

Since 2012 Software Mansion is a software agency with experience in building web and mobile apps. We are Core React Native Contributors and experts in dealing with all kinds of React Native issues. We can help you build your next dream product – Hire us.

Made by @software-mansion and community 💛

About

Universal sharing function for Compose Multiplatform.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •  

Languages