Component
CodeBlock
A monospace block for tokens and URLs — select-all by default, one-press copy on request.
import { CodeBlock } from '@loidolt/theme-svelte';
Example
sk_live_9f2c4d8e1a7b3f6c https://example.com/proof/pf_q7MU9R2IgF7TuQxRP Notes
- Copy success is announced through a persistently mounted status region.
- Clipboard access can be denied; the text stays selectable either way.
Props
Generated from the component source, so it cannot drift from the implementation.
| Prop | Type | Default | Notes |
|---|---|---|---|
code required | string | — | |
class | string | — | |
copiedLabel | string | 'Copied' | |
copyable | boolean | false | |
copyLabel | string | 'Copy' | |
ref bindable | HTMLDivElement | null | null | |
selectable | boolean | true | One click/tap selects the whole value. On by default — this block exists for copying. |
Plus the attributes of Omit<HTMLAttributes<HTMLDivElement>, 'children'>, forwarded to the root element.