# Clipboard

Artifact: [androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/platform/Clipboard.kt+class:androidx.compose.ui.platform.Clipboard) Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.8.0) Common/AllAndroid/JVM
- Cmn

  ```
  interface Clipboard
  ```
Known direct subclasses [AndroidClipboard](https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/AndroidClipboard)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/AndroidClipboard` | Android-specific implementation of the `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/Clipboard` interface that provides access to the underlying `https://developer.android.com/reference/android/content/ClipboardManager.html`. |

*** ** * ** ***

## Summary

| ### Public functions |
|---|---|---|
| `suspend https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/ClipEntry?` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/Clipboard#getClipEntry()()` Returns the clipboard entry that's provided by the platform's ClipboardManager. | Cmn |
| `suspend https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/Clipboard#setClipEntry(androidx.compose.ui.platform.ClipEntry)(clipEntry: https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/ClipEntry?)` Puts the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/Clipboard#setClipEntry(androidx.compose.ui.platform.ClipEntry)` in platform's ClipboardManager. | Cmn |

| ### Public properties |
|---|---|---|
| `open https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/NativeClipboard` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/Clipboard#nativeClipboard()` **This property is deprecated.** Use platform-specific extension to get platform reference | Cmn |

| ### Extension properties |
|---|---|---|
| `https://developer.android.com/reference/android/content/ClipboardManager.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/Clipboard.https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/Clipboard#(androidx.compose.ui.platform.Clipboard).nativeClipboardManager()` Returns an `https://developer.android.com/reference/android/content/ClipboardManager.html` that exposes the full functionality of platform clipboard. | android |

## Public functions

### getClipEntry

Cmn

```
suspend fun getClipEntry(): ClipEntry?
```

Returns the clipboard entry that's provided by the platform's ClipboardManager.

This item can include arbitrary content like text, images, videos, or any data that may be provided through a mediator. Returned entry may contain multiple items with different types.

It returns null when the clipboard is empty.

Calling this function on Android will access the Clipboard's contents, and the first time it happens this will trigger a warning that says "App pasted from Clipboard". Use `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/Clipboard#nativeClipboard()` and `primaryClipDescription` on Android to circumvent this issue if you are only interested in querying what is available in the clipboard.

### setClipEntry

Cmn Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.8.0)

```
suspend fun setClipEntry(clipEntry: ClipEntry?): Unit
```

Puts the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/Clipboard#setClipEntry(androidx.compose.ui.platform.ClipEntry)` in platform's ClipboardManager.

| Parameters |
|---|---|
| `clipEntry: https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/ClipEntry?` | Platform specific clip object that either holds data or links to it. Pass null to clear the clipboard. |

## Public properties

### nativeClipboard

Cmn Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.8.0) Deprecated in [1.12.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.12.0)

```
open val nativeClipboard: NativeClipboard
```

> [!CAUTION]
> **This property is deprecated.**   
> Use platform-specific extension to get platform reference

Returns the native clipboard that exposes the full functionality of platform clipboard.

## Extension properties

### Clipboard.nativeClipboardManager

android Artifact: [androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/platform/AndroidClipboard.android.kt+symbol:nativeClipboardManager)

```
val Clipboard.nativeClipboardManager: ClipboardManager
```

Returns an `https://developer.android.com/reference/android/content/ClipboardManager.html` that exposes the full functionality of platform clipboard.