Skip to content

Commit 31871fa

Browse files
author
Timo Bechtel
committed
docs(README): extend README
1 parent 7390484 commit 31871fa

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,20 @@ npm install @compactjs/clipboard
4949
import { clipboard } from '@compactjs/clipboard';
5050
```
5151

52+
API:
53+
54+
```typescript
55+
/**
56+
* Copy text to clipboard.
57+
* @param input Either text to copy or HTMLElement to copy from
58+
*/
59+
function clipboard(
60+
input: string | HTMLTextAreaElement | HTMLInputElement
61+
): void;
62+
```
63+
64+
**Note:** A copy to clipboard need to be triggered by user action, like a button press!
65+
5266
### Example:
5367

5468
```javascript

0 commit comments

Comments
 (0)