---
title: "copy"
description: "The method for copying text."
type: "function"
---
## API Reference

### copy

> Source set: Common

```kotlin
suspend fun copy(cancelSelection: Boolean = true)
```

The method for copying text.

If there is no selection, return. Put the selected text into the `Clipboard`, and cancel the
selection, if `cancelSelection` is true. The text in the text field should be unchanged. If
`cancelSelection` is true, the new cursor offset should be at the end of the previous
selected text.
