Skip to content

Commit

Permalink
Adds an example of copy clipboard with array of objects. (#2916)
Browse files Browse the repository at this point in the history
* Fixes #2845 - Copy Clipboard example using an array.

* fix(docs): Provides an example for using copy clipboard with an array.

"fix #2845"
  • Loading branch information
dlabaj authored and redallen committed Sep 17, 2019
1 parent 26320f3 commit 42201a0
Showing 1 changed file with 17 additions and 0 deletions.
Expand Up @@ -43,3 +43,20 @@ import { ClipboardCopy, ClipboardCopyVariant } from '@patternfly/react-core';
expansion.
</ClipboardCopy>
```
## Expanded clipboard copy with array
```js
import React from 'react';
import { ClipboardCopy, ClipboardCopyVariant } from '@patternfly/react-core';

ClipboardCopyArrayOfElements = () => {
let text = [
"Got a lot of text here," ,
"need to see all of it?" ,
"Click that arrow on the left side and check out the resulting expansion."
]
return <ClipboardCopy variant={ClipboardCopyVariant.expansion}>
{text.join(" ")}
</ClipboardCopy>
}
```

0 comments on commit 42201a0

Please sign in to comment.