1ddffb4162
* ui: Renames CopyButtonFeedback to CopyButton and use it everywhere * Uncapitalize output * Remove the ability to set the contents via an attr, and.. ..change the attribute for the string that gets copied to be called 'value' so it feels like HTML
33 lines
789 B
Plaintext
33 lines
789 B
Plaintext
## CopyButton
|
|
|
|
```handlebars
|
|
{{! inline }}
|
|
<CopyButton
|
|
@value={{stringToCopy}}
|
|
@name="Thing"
|
|
/>
|
|
|
|
<CopyButton
|
|
@value={{stringToCopy}}
|
|
@name="Thing"
|
|
>
|
|
Copy me!
|
|
</CopyButton>
|
|
```
|
|
|
|
### Arguments
|
|
|
|
| Argument | Type | Default | Description |
|
|
| --- | --- | --- | --- |
|
|
| `value` | `String` | | The string to be copied to the clipboard on click |
|
|
| `name` | `String` | | The 'Name' of the string to be copied. Mainly used for giving feedback to the user |
|
|
|
|
This component renders a simple button, when clicked copies the value (the `@value` attribute) to the users clipboard. A simple piece of feedback is given to the user in the form of a tooltip. When used inline an empty button is rendered.
|
|
|
|
### See
|
|
|
|
- [Component Source Code](./index.js)
|
|
- [Template Source Code](./index.hbs)
|
|
|
|
---
|