
Multiplatform abstraction for clipboard management, enabling consistent clipboard handling across different environments.
A multiplatform abstraction for dealing with clipboards.
LocalClipboard for testing or internal app usage.| Module | JVM | Android | iOS | macOS | watchOS/tvOS | Linux | Windows | JS/Wasm |
|---|---|---|---|---|---|---|---|---|
| klip-api | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| klip-local | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| klip-system | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Add the dependency to your build.gradle.kts file:
kotlin {
sourceSets {
val commonMain by getting {
dependencies {
implementation("tz.co.asoft:klip-api:<version>")
implementation("tz.co.asoft:klip-system:<version>") // To be used in production environments
implementation("tz.co.asoft:klip-local:<version>") // To be used testing & mock environments
}
}
}
}dependencies {
implementation("tz.co.asoft:klip-system:<version>")
}The SystemClipboard class provides access to the platform's native clipboard.
val clipboard = SystemClipboard()
// Setting plain text
clipboard.set("Hello from Klip!")
// Getting current entry
val entry = clipboard.entry()
if (entry is PlainTextClipEntry) {
println(entry.content)
}Useful for testing or when you need a clipboard scoped only to your application.
val clipboard = LocalClipboard()
clipboard.set("Secret data")You can use ClipEntry for more structured data (currently primarily supports PlainText).
val entry = PlainText("Structured Text")
clipboard.set(entry)Klip has been implemented with with extensibility in mind, and supports the following ClipEntry types:
✅ PlainText (Current available)
❌ File/Blob (To be implemented)
❌ Image (To be implemented)
❌ Url (To be implemented)
This project is licensed under the MIT License - see the LICENSE file for details.
A multiplatform abstraction for dealing with clipboards.
LocalClipboard for testing or internal app usage.| Module | JVM | Android | iOS | macOS | watchOS/tvOS | Linux | Windows | JS/Wasm |
|---|---|---|---|---|---|---|---|---|
| klip-api | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| klip-local | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| klip-system | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Add the dependency to your build.gradle.kts file:
kotlin {
sourceSets {
val commonMain by getting {
dependencies {
implementation("tz.co.asoft:klip-api:<version>")
implementation("tz.co.asoft:klip-system:<version>") // To be used in production environments
implementation("tz.co.asoft:klip-local:<version>") // To be used testing & mock environments
}
}
}
}dependencies {
implementation("tz.co.asoft:klip-system:<version>")
}The SystemClipboard class provides access to the platform's native clipboard.
val clipboard = SystemClipboard()
// Setting plain text
clipboard.set("Hello from Klip!")
// Getting current entry
val entry = clipboard.entry()
if (entry is PlainTextClipEntry) {
println(entry.content)
}Useful for testing or when you need a clipboard scoped only to your application.
val clipboard = LocalClipboard()
clipboard.set("Secret data")You can use ClipEntry for more structured data (currently primarily supports PlainText).
val entry = PlainText("Structured Text")
clipboard.set(entry)Klip has been implemented with with extensibility in mind, and supports the following ClipEntry types:
✅ PlainText (Current available)
❌ File/Blob (To be implemented)
❌ Image (To be implemented)
❌ Url (To be implemented)
This project is licensed under the MIT License - see the LICENSE file for details.