# `src/components/copy-to-clipboard/CopyToClipboard.ts`:

## class: `CopyToClipboard`, `btu-copy-to-clipboard`

### Superclass

| Name         | Module | Package |
| ------------ | ------ | ------- |
| `LitElement` |        | lit     |

### Mixins

| Name                   | Module                            | Package |
| ---------------------- | --------------------------------- | ------- |
| `ClipboardMixin`       | /src/util/ClipboardMixin.js       |         |
| `ComponentStatesMixin` | /src/util/ComponentStatesMixin.js |         |
| `EventEmitterMixin`    | /src/util/EventEmitterMixin.js    |         |
| `ReadyMixin`           | /src/util/ReadyMixin.js           |         |

### Fields

| Name             | Privacy | Type                             | Default | Description                                                                     | Inherited From |
| ---------------- | ------- | -------------------------------- | ------- | ------------------------------------------------------------------------------- | -------------- |
| `copydata`       |         | `string \| undefined`            |         | The text to be copied to the system clipboard.                                  |                |
| `buttonClasses`  |         | `string \| undefined`            |         | Custom CSS classes for the button. If provided, replaces the default classes.   |                |
| `copiedStateKey` |         | `'btu-copy-to-clipboard-copied'` |         | Custom state applied briefly after a successful copy; also emitted as an event. | ClipboardMixin |

### Methods

| Name   | Privacy | Description                                                                                                                                                                                                                                                                        | Parameters                                              | Return    | Inherited From    |
| ------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- | --------- | ----------------- |
| `copy` |         | Copies the copydata to the system clipboard.&#xA;Displays a success state for 3 seconds after copying.                                                                                                                                                                             | `text: string, timeout`                                 |           | ClipboardMixin    |
| `emit` |         | Dispatches a type-safe CustomEvent with standardized configuration.&#xA;&#xA;All events are configured with:&#xA;- bubbles: true (event propagates up the DOM tree)&#xA;- cancelable: false (event cannot be cancelled)&#xA;- composed: true (event crosses shadow DOM boundaries) | `type: K, detail: UnpackCustomEvent<CustomEventMap[K]>` | `boolean` | EventEmitterMixin |

### Events

| Name                           | Type          | Description                                         | Inherited From |
| ------------------------------ | ------------- | --------------------------------------------------- | -------------- |
| `btu-copy-to-clipboard-ready`  | `CustomEvent` | Fired after first render and initialization         |                |
| `btu-copy-to-clipboard-copied` | `CustomEvent` | Fired when text is successfully copied to clipboard |                |

### Attributes

| Name            | Field         | Inherited From |
| --------------- | ------------- | -------------- |
| `copydata`      | copydata      |                |
| `buttonClasses` | buttonClasses |                |

<hr/>

## Exports

| Kind                        | Name                    | Declaration     | Module                                              | Package |
| --------------------------- | ----------------------- | --------------- | --------------------------------------------------- | ------- |
| `js`                        | `default`               | CopyToClipboard | src/components/copy-to-clipboard/CopyToClipboard.ts |         |
| `custom-element-definition` | `btu-copy-to-clipboard` | CopyToClipboard | src/components/copy-to-clipboard/CopyToClipboard.ts |         |
