CopyableToken
Click-to-copy token displayed as an inline code label
Interactive-mode
Divergence from Blok
Interactive feedback beyond Blok. Blok's source renders a static tooltip with Copy to clipboard and silently copies on click. BlazorUI additionally:
- Swaps the tooltip text to a confirmation message on click, then hides the tooltip after 1s (reset when the cursor leaves the token).
- Exposes
CopyMessage(default"Copy to clipboard") andCopiedMessage(default"Copied") parameters so callers can localise or re-word the states. - Fires a
ClickedEventCallback<string>with the copied value so callers can react (analytics, a secondary toast, audit logging).
Examples
Default
api-key-4f2a9c71
Copy to clipboard
UUID token
3b5e4d2f-7a1c-4f9b-8d6e-1a2b3c4d5e6f
Copy to clipboard
Inline within prose
Run
npm install
Copy to clipboard
Multiple tokens in a stack
client_id
Copy to clipboard
client_secret
Copy to clipboard
redirect_uri
Copy to clipboard
Custom messages
sk-live-9f2a
Click to copy secret
Clicked callback
abc-123-def
Copy to clipboard
API
The element family below can be composed together. Click an element to jump to its properties.
| Element | Purpose |
|---|---|
| CopyableToken | Inline <code> label that copies Token to the clipboard when clicked. Wraps a Tooltip that swaps from CopyMessage to CopiedMessage for a brief confirmation window. |
CopyableToken
Inline <code> label that copies Token to the clipboard when clicked. Wraps a Tooltip that swaps from CopyMessage to CopiedMessage for a brief confirmation window.
| Property | Type | Required | Description |
|---|---|---|---|
| Token | string | Text to display and copy to the clipboard on click. | |
| CopyMessage | string | Tooltip text shown on hover before clicking. Default: "Copy to clipboard". | |
| CopiedMessage | string | Tooltip text shown briefly after a successful copy. Default: "Copied". | |
| Clicked | EventCallback<string> | Fires with the copied value after the clipboard write succeeds. Useful for analytics or audit logging. | |
| ClassName | string? | Extra CSS classes appended to the token <code> element. | |
| AdditionalAttributes | Dictionary<string, object>? | Captured unmatched attributes, forwarded to the token <code> element. |