Documentation Index
Fetch the complete documentation index at: https://mintlify.com/finsweet/attributes/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The CopyClip attribute allows you to add copy-to-clipboard functionality to any element on your page. When users click the element, it copies specified text to their clipboard and optionally displays a success message.Attribute Syntax
Elements
Defines the type of element in the copy workflow:
click- The trigger element that users click to copycopy-this- The target element whose content will be copiedcopy-sibling- A sibling element whose content will be copied
Settings
Defines the exact text that will be copied to the clipboard. If not set, the attribute will copy content from the target element.
Defines the success message displayed in the trigger element after copying. The message appears temporarily and then reverts to the original text.
Defines how long (in milliseconds) the success state persists before reverting to the original state.
Defines the CSS class added to the trigger element during the success state. Use this to style the active state.
Usage Examples
Common Use Cases
Code Snippet Copy
Add one-click copying for code examples, making it easy for users to copy commands, API keys, or code snippets without manual selection.Contact Information
Provide quick copying of email addresses, phone numbers, or other contact details with visual feedback.Share Links
Enable users to copy shareable URLs, referral codes, or social media handles with a single click.Form Data
Allow users to copy generated values like confirmation codes, transaction IDs, or temporary passwords.Styling the Active State
Use the active class to provide visual feedback:The attribute uses the Clipboard.js library internally to ensure cross-browser compatibility.