ClickToCopy[expr]
represents a button that copies expr whenever it is clicked.
ClickToCopy[label,expr]
displays with label on the button.
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 all close allBasic Examples (4)
Create a button that copies the given string when clicked:
ClickToCopy["hello world"]Create a click-to-copy typeset expression:
ClickToCopy[x ^ 3 + 2x + 1]Create a click-to-copy graphic:
ClickToCopy[Plot3D[Sin[x y], {x, 0, 3}, {y, 0, 3}]]Create several buttons for copying items individually:
ClickToCopy /@ Range[50]Scope (2)
Properties & Relations (3)
Use RawBoxes to synthesize a box expression for copying:
ClickToCopy[RawBoxes[FractionBox[RowBox[{"y", "-", SubscriptBox["y", "0"]}], RowBox[{"x", "-", SubscriptBox["x", "0"]}]]]]Copy nondefault expression formatting:
ClickToCopy[InputForm[x ^ 3 + 2x + 1]]Specify an object that copies with an appearance different from its interpretation:
ClickToCopy[Interpretation[x ^ 3, y ^ 2]]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:
ClickToCopy[∫Sqrt[x + Sqrt[x]]ⅆx]Controls within a ClickToCopy output will not be accessible to mouse events:
ClickToCopy[Manipulate[x, {x, 0, 1}]]See Also
Related Guides
History
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_2026_clicktocopy, author="Wolfram Research", title="{ClickToCopy}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/ClickToCopy.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_clicktocopy, organization={Wolfram Research}, title={ClickToCopy}, year={2020}, url={https://reference.wolfram.com/language/ref/ClickToCopy.html}, note=[Accessed: 13-June-2026]}