TogglerBox[x,{val1pict1,val2pict2,…}]
represents a toggler button that cycles through values vali, displaying them as picti.
TogglerBox[x,vlist,dpict]
displays as dpict if x is none of the vali.
TogglerBox
TogglerBox[x,{val1pict1,val2pict2,…}]
represents a toggler button that cycles through values vali, displaying them as picti.
TogglerBox[x,vlist,dpict]
displays as dpict if x is none of the vali.
Details and Options
- TogglerBox is generated as the low-level representation of Toggler. Except for low-level notebook expression manipulation, TogglerBox should not need to be used directly.
- The picti are boxes. To use the box form of the value, use the input TogglerBox[x,{val1ToBoxes[val1],val2ToBoxes[val2],…}].
- The following options can be given:
-
AutoAction False whether to change the toggler automatically when the mouse is over it Background Automatic background color BaselinePosition Automatic alignment relative to surrounding text BaseStyle {} base style specifications for the displayed toggler ContentPadding True whether to shrink the margins tightly around the contents Enabled Automatic whether the toggler is enabled or grayed out ImageMargins 0 margins around the image of the displayed toggler ImageSize All the overall image size of the displayed toggler
Examples
Basic Examples (2)
Click the output to toggle its value:
RawBoxes[TogglerBox[1, {1 -> "1", 2 -> "2", 3 -> "3", 4 -> "4"}]]Dynamically change the value of
:
{RawBoxes[TogglerBox[Dynamic[x], {1 -> "1", 2 -> "2", 3 -> "3", 4 -> "4"}]], Dynamic[x]}Display the last element (), since the setting is not in the list of values:
RawBoxes[TogglerBox[0, {1 -> "1", 2 -> "2"}, StyleBox["", 30]]]Use any type of expression as values:
g = Plot[Sin[x], {x, 0, 2π}, Axes -> False, ImageSize -> 40];
f = Sqrt[y]Tan[α y - β];
s = "αβγ";{RawBoxes[TogglerBox[Dynamic[x], {g -> ToBoxes[g], f -> ToBoxes[f], s -> ToBoxes[s]}, Alignment -> Center]], Dynamic[x]}See Also
History
Text
Wolfram Research (2007), TogglerBox, Wolfram Language function, https://reference.wolfram.com/language/ref/TogglerBox.html.
CMS
Wolfram Language. 2007. "TogglerBox." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/TogglerBox.html.
APA
Wolfram Language. (2007). TogglerBox. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TogglerBox.html
BibTeX
@misc{reference.wolfram_2026_togglerbox, author="Wolfram Research", title="{TogglerBox}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/TogglerBox.html}", note=[Accessed: 22-July-2026]}
BibLaTeX
@online{reference.wolfram_2026_togglerbox, organization={Wolfram Research}, title={TogglerBox}, year={2007}, url={https://reference.wolfram.com/language/ref/TogglerBox.html}, note=[Accessed: 22-July-2026]}