By design, the copy button does not copy text to the clipboard. You will need to write your own logic. Refer to the CopyableCodeSnippet recipe for an example.
### Default (single-line) yarn add -D carbon-components-svelte ### Inline rm -rf node_modules/ ### Multi-line ### Hidden copy button ### Disabled The `disabled` prop applies only to the `"single"` and `"multi"` code snippet types. yarn add -D carbon-components-svelte
### Wrapped text `wrapText` only applies to the `"multi"` type. ### Dynamic multi-line code For dynamically updated code, you must use the `code` prop instead of the default slot. ### Hidden multi-line code There may be cases where your code snippet is hidden in the DOM. The logic to render the "Show more" button relies on the element's computed height. For hidden content, the button will not appear because the computed height is `0`. The recommended workaround is to re-render the component. See the example below. ### Skeleton The default skeleton type is `"single"`. ### Skeleton (multi-line)