open-consul/ui/packages/consul-ui/app/components/copy-button
John Cowen ac65aa80c6
ui: Remove storybook, add docfy (#9831)
This PR removes storybook and adds docfy and uses docfy to render our existing README files.

This now means we can keep adding README documentation without committing any specific format or framework. If we eventually move to storybook then fine, or if we just want to remove docfy for whatever reason then fine - we will still have a full set of README files viewable via GitHub.
2021-03-08 12:22:01 +00:00
..
README.mdx ui: Remove storybook, add docfy (#9831) 2021-03-08 12:22:01 +00:00
chart.xstate.js ui: Move to Workspaced Structure (#8994) 2020-10-21 15:23:16 +01:00
index.hbs ui: Modifier based tooltips (#9288) 2020-11-30 16:52:13 +00:00
index.js ui: Modifier based tooltips (#9288) 2020-11-30 16:52:13 +00:00

README.mdx

# CopyButton

```hbs preview-template
<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)

---