ClickToCopy

ClickToCopy[expr]

represents a button that copies expr whenever it is clicked.

ClickToCopy[label,expr]

displays with label on the button.

Details

  • expr can be any Wolfram Language expression.
  • ClickToCopy[Defer[expr]] creates a button that displays and copies the unevaluated form of expr.
  • ClickToCopy[expr] typically renders with different margins than expr to accommodate hover behaviors.

Examples

open allclose all

Basic Examples  (4)

Create a button that copies the given string when clicked:

Create a click-to-copy typeset expression:

Create a click-to-copy graphic:

Create several buttons for copying items individually:

Scope  (2)

Create a click-to-copy button with a label:

Create a button for copying an expression without evaluating it:

Properties & Relations  (3)

Use RawBoxes to synthesize a box expression for copying:

Copy nondefault expression formatting:

Specify an object that copies with an appearance different from its interpretation:

Possible Issues  (2)

ClickToCopy prevents selecting pieces of the result with the mouse, but the arrow keys can still be used to navigate the output:

Controls within a ClickToCopy output will not be accessible to mouse events:

Wolfram Research (2020), ClickToCopy, Wolfram Language function, https://reference.wolfram.com/language/ref/ClickToCopy.html.

Text

Wolfram Research (2020), ClickToCopy, Wolfram Language function, https://reference.wolfram.com/language/ref/ClickToCopy.html.

CMS

Wolfram Language. 2020. "ClickToCopy." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ClickToCopy.html.

APA

Wolfram Language. (2020). ClickToCopy. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ClickToCopy.html

BibTeX

@misc{reference.wolfram_2023_clicktocopy, author="Wolfram Research", title="{ClickToCopy}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/ClickToCopy.html}", note=[Accessed: 29-March-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_clicktocopy, organization={Wolfram Research}, title={ClickToCopy}, year={2020}, url={https://reference.wolfram.com/language/ref/ClickToCopy.html}, note=[Accessed: 29-March-2024 ]}