The copy button enables users to quickly copy a predefined block of code or snippets of text to the clipboard.

When the user is presented with a source code snippet or text strings they may need to paste elsewhere, it's helpful to provide a copy button to allow them to quickly copy it instead.

Example

⌘ Cmd + ⌥ Option + 1

Properties

propertypropTyperequireddefaultdescription
testSectionstring--Hook for automated JavaScript tests
textToCopystringyes-The text or code that will be copied

Usage

Make sure the copy button doesn't cover up any of the code, the top right is usually a good location.

Do

Place the copy button in a clear and visible location, not covering any content

Don't

Cover up the code or snippet with the button

Don't place outside of an obvious container. It should be clear what is being copied