mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
26 lines
467 B
Svelte
26 lines
467 B
Svelte
<script lang="ts">
|
|
import { CopyButton } from "carbon-components-svelte";
|
|
</script>
|
|
|
|
<CopyButton
|
|
text="text"
|
|
iconDescription="Basic"
|
|
on:copy={() => {
|
|
console.log("copied");
|
|
}}
|
|
/>
|
|
|
|
<CopyButton
|
|
iconDescription="Custom feedback"
|
|
text="text"
|
|
feedback="Copied to clipboard"
|
|
feedbackTimeout={0}
|
|
/>
|
|
|
|
<CopyButton
|
|
text="Custom copy function"
|
|
iconDescription="Custom copy function"
|
|
copy={(text) => {
|
|
console.log(`Custom copy: ${text}`);
|
|
}}
|
|
/>
|