This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Checkbox

Checkbox[x]
represents a checkbox with setting x, displayed as when x is True and when x is False.
Checkbox[Dynamic[x]]
takes the setting to be the dynamically updated current value of x, with the value of x being toggled if the checkbox is clicked.
Checkbox
represents a checkbox that toggles between values and , and displays as and respectively.
Checkbox
represents a checkbox that cycles through values , and displays as for all with i>2.
  • The following options can be given:
AppearanceAutomaticthe overall appearance of the checkbox
AutoActionFalsewhether to change the checkbox automatically when the mouse is over it
BaselinePositionAutomaticalignment relative to surrounding text
EnabledAutomaticwhether the checkbox is enabled, or grayed out
ImageMargins0margins around the image of the displayed checkbox
The default states for Checkbox:
Using different values for states:
The default states for Checkbox:
In[1]:=
Click for copyable input
Out[1]=
 
Using different values for states:
In[1]:=
Click for copyable input
Out[1]=
By using Dynamic variables within Checkbox the state variable is dynamically updated:
Here the value of x cycles through the list :
Control the appearance of the checkbox:
Dynamically changing appearance:
By default, the checkbox does not change state until it is clicked:
By setting AutoAction, the checkbox changes state when the mouse moves over it:
Values will change as the cursor is moved over the clickable area:
Change the background color:
Dynamically change the background color:
Align with surrounding text:
The Enabled option allows the checkbox to be changed:
The Enabled option can be changed dynamically for use in applications:
Change the margins around the image:
Use Checkbox to set variables corresponding to a three-way light switch:
Control options through checkboxes:
Use checkboxes to build a dynamic truth table:
Count the number of clicks in a Checkbox:
Checkbox is a special case of Toggler:
New in 6