# ClientClipboard

The [Clipboard ](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API)extension provides the ability to respond to clipboard commands (cut, copy, and paste) as well as to asynchronously read from and write to the system clipboard.

{% embed url="<https://github.com/iceteagroup/wisej-extensions/tree/master/Wisej.Ext.ClientClipboard>" %}
ClientClipboard Source Code
{% endembed %}

## Features

* Write to the client's clipboard.
* Read the client's clipboard contents.

{% hint style="danger" %}
Some features are not available in all browsers. Be sure to check the latest documentation on MSDN.
{% endhint %}

## How to Use

The **ClientClipboard** extension can be added to a Wisej.NET project using NuGet Package Manager.

{% embed url="<https://www.nuget.org/packages/Wisej-3-ClientClipboard>" %}

### Clipboard Events

Handle when the user copies, cuts, or pastes content to or from the clipboard.

```csharp
ClientClipboard.ClipboardChange += new ClientClipboardEventHandler(ClientClipboard_ClipboardChange)
```

### Write to the Clipboard

Writes the specified text to the client clipboard.

```csharp
await ClientClipboard.WriteTextAsync("Hello, World!");
```

### Read from the Clipboard

Returns the textual content of the client clipboard.

```csharp
var text = await ClientClipboard.ReadTextAsync();
```
