let
| No | string
| "Copy to clipboard"
| Set the title and ARIA label for the copy button |
+| text | let
| No | string
| -- | Specify the text to copy |
### Slots
@@ -877,10 +878,11 @@ None.
### Events
-| Event name | Type | Detail |
-| :----------- | :-------- | :----- |
-| click | forwarded | -- |
-| animationend | forwarded | -- |
+| Event name | Type | Detail |
+| :----------- | :--------- | :----- |
+| click | forwarded | -- |
+| animationend | forwarded | -- |
+| copy | dispatched | -- |
## `DataTable`
diff --git a/docs/package.json b/docs/package.json
index 38754d06..92d5c242 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -13,7 +13,6 @@
"autoprefixer": "^10.2.3",
"carbon-components": "10.32.0-rc.0",
"carbon-components-svelte": "../",
- "clipboard-copy": "^3.1.0",
"mdsvex": "^0.8.8",
"npm-run-all": "^4.1.5",
"postcss": "^8.2.4",
diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json
index 73399002..78f67b05 100644
--- a/docs/src/COMPONENT_API.json
+++ b/docs/src/COMPONENT_API.json
@@ -1862,12 +1862,22 @@
"isFunction": false,
"constant": false,
"reactive": false
+ },
+ {
+ "name": "text",
+ "kind": "let",
+ "description": "Specify the text to copy",
+ "type": "string",
+ "isFunction": false,
+ "constant": false,
+ "reactive": false
}
],
"slots": [],
"events": [
{ "type": "forwarded", "name": "click", "element": "Copy" },
- { "type": "forwarded", "name": "animationend", "element": "Copy" }
+ { "type": "forwarded", "name": "animationend", "element": "Copy" },
+ { "type": "dispatched", "name": "copy" }
],
"typedefs": [],
"rest_props": { "type": "InlineComponent", "name": "Copy" },
diff --git a/docs/src/pages/components/CopyButton.svx b/docs/src/pages/components/CopyButton.svx
index a04a332a..61eea74d 100644
--- a/docs/src/pages/components/CopyButton.svx
+++ b/docs/src/pages/components/CopyButton.svx
@@ -4,13 +4,13 @@