({{, (RefLink[Checkbox, paclet:ref/Checkbox])[x]
represents a checkbox with setting x, displayed as  when x is (RefLink[True, paclet:ref/True]) and  when x is (RefLink[False, paclet:ref/False]). }, {, (RefLink[Checkbox, paclet:ref/Checkbox])[(RefLink[Dynamic, paclet:ref/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. }, {, (RefLink[Checkbox, paclet:ref/Checkbox])[x,{(Subscript[val, 1]),(Subscript[val, 2])}]
represents a checkbox that toggles between values (Subscript[val, 1]) and (Subscript[val, 2]) and displays as  and , respectively. }, {, (RefLink[Checkbox, paclet:ref/Checkbox])[x,{(Subscript[val, 1]),(Subscript[val, 2]),(Subscript[val, 3]),…}]
represents a checkbox that cycles through values (Subscript[val, i]) and displays as  for all (Subscript[val, i]) with i>2. }})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[Checkbox, paclet:ref/Checkbox]) is effectively a special case of (RefLink[Toggler, paclet:ref/Toggler]).

The following options can be given:

Typical possible settings for (RefLink[Appearance, paclet:ref/Appearance]) include (RefLink[Small, paclet:ref/Small]), (RefLink[Medium, paclet:ref/Medium]), and (RefLink[Large, paclet:ref/Large]).

(RefLink[Checkbox, paclet:ref/Checkbox])[] is equivalent to (RefLink[Checkbox, paclet:ref/Checkbox])[(RefLink[False, paclet:ref/False])].

OpenersPrimaryExamplesSection(Spacer1)Examples  (18)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

The default states for (RefLink[Checkbox, paclet:ref/Checkbox]):

{Checkbox[False],Checkbox[True]}

Using different values for states:

{Checkbox[1,{1,2,3}],Checkbox[2,{1,2,3}],Checkbox[3,{1,2,3}]}

OpenersExampleSection1(Spacer1)Scope  (3)

By using (RefLink[Dynamic, paclet:ref/Dynamic]) variables within (RefLink[Checkbox, paclet:ref/Checkbox]), the state variable is dynamically updated:

{Checkbox[Dynamic[x]],Dynamic[x]}

Here the value of x cycles through the list {1,2,3,4}:

{Checkbox[Dynamic[x],{1,2,3,4}],Dynamic[x]}

Multiple checkboxes can share the same state variable:

{Checkbox[Dynamic[x],{2,1}],Checkbox[Dynamic[x],{1,2}],Dynamic[x]}

OpenersExampleSection2(Spacer1)Options  (8)

OpenersExampleSubsection0(Spacer1)Appearance  (2)

Control the appearance of the checkbox:

Table[Checkbox[Appearance->a],{a,{Tiny,Small,Medium,Large}}]

Dynamically changing appearance:

{Checkbox[Dynamic[x],{Tiny,Large},Appearance->Dynamic[x]],Dynamic[x]}

OpenersExampleSubsection1(Spacer1)AutoAction  (2)

By default, the checkbox does not change state until it is clicked:

Checkbox[]

By setting (RefLink[AutoAction, paclet:ref/AutoAction]), the checkbox changes state when the mouse moves over it:

Checkbox[AutoAction->True]

Values will change as the cursor is moved over the clickable area:

Checkbox[Dynamic[x],AutoAction->True]

OpenersExampleSubsection2(Spacer1)BaselinePosition  (1)

Align with surrounding text:

Row[Table[Checkbox[BaselinePosition->b],{b,{Bottom,Center,Top}}],"xxx"]

OpenersExampleSubsection3(Spacer1)Enabled  (2)

The (RefLink[Enabled, paclet:ref/Enabled]) option allows the checkbox to be changed:

{Checkbox[Dynamic[x],Enabled->False],Checkbox[Dynamic[x],Enabled->True]}

The (RefLink[Enabled, paclet:ref/Enabled]) option can be changed dynamically for use in applications:

{Checkbox[Dynamic[x]],Checkbox[Dynamic[y],Enabled->Dynamic[x]]}

OpenersExampleSubsection4(Spacer1)ImageMargins  (1)

Change the margins around the image:

Table[Framed@Checkbox[ImageMargins->m],{m,{0,5,10,30}}]

OpenersExampleSection3(Spacer1)Applications  (4)

Use (RefLink[Checkbox, paclet:ref/Checkbox]) to set variables corresponding to a three-way light switch:

Row[{Checkbox[Dynamic[x]],Checkbox[Dynamic[y]],Checkbox[Dynamic[z]],"⟹",Dynamic[Xor[x,y,z]]}]

Control options through checkboxes:

{AxesLabel->{Checkbox[Dynamic[xlab],{"","x"},Enabled->Dynamic[axes]],Checkbox[Dynamic[ylab],{"","y"},Enabled->Dynamic[axes]]},
Axes->Checkbox[Dynamic[axes],{False,True}]}

Graphics[{Opacity[.5],Table[{Hue[RandomReal[]],Rectangle[RandomReal[2,2]]},{20}]},AxesLabel->{Dynamic[xlab],Dynamic[ylab]},Axes->Dynamic[axes]]

Use checkboxes to build a dynamic truth table:

DynamicTruthTable[f_,vars_]:=
DynamicModule[{v,arr,e,tt},
(* localize *)
v=Array[arr,{Length[vars]}];
e=Function[Evaluate[f/.Thread[vars->Array[Slot,{Length[vars]}]]]];
(* truth table *)
tt=Grid[{Append[vars,TraditionalForm[f]],Append[Map[Composition[Checkbox,Dynamic],v],Apply[Composition[Dynamic,Evaluate[e]], v]]},Dividers->{All,All}];
(* initialize *)
Do[arr[i]=False,{i,Length[vars]}];
tt
]

DynamicTruthTable[And[Or[a,b],b,c],{a,b,c}]

Count the number of clicks in a (RefLink[Checkbox, paclet:ref/Checkbox]):

DynamicModule[{x=False,changeCount=0},Column[{Checkbox[Dynamic[x,(x=#;changeCount++)&],{False,True}],Row[{"x is ",Dynamic[x]}],Row[{"x has been changed ",Dynamic[changeCount]," times."}]}]]

OpenersExampleSection4(Spacer1)Properties & Relations  (1)

(RefLink[Checkbox, paclet:ref/Checkbox]) is a special case of (RefLink[Toggler, paclet:ref/Toggler]):

{Toggler[Dynamic[x],{False,True}],Dynamic[x]}

{Checkbox[Dynamic[y]],Dynamic[y]}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Toggler, paclet:ref/Toggler])  ▪  (RefLink[Opener, paclet:ref/Opener])  ▪  (RefLink[Setter, paclet:ref/Setter])  ▪  (RefLink[Panel, paclet:ref/Panel])  ▪  (RefLink[RadioButton, paclet:ref/RadioButton])  ▪  (RefLink[Control, paclet:ref/Control])  ▪  (RefLink[CheckboxBar, paclet:ref/CheckboxBar])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Introduction to Dynamic, paclet:tutorial/IntroductionToDynamic])}, {▪(RefLinkPlain[Introduction to Control Objects, paclet:tutorial/IntroductionToControlObjects])}, {▪(RefLinkPlain[Generalized Input, paclet:tutorial/GeneralizedInput])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Control Objects, paclet:guide/ControlObjects])}, {▪(RefLinkPlain[Generalized Input, paclet:guide/GeneralizedInput])}, {▪(RefLinkPlain[Dynamic Interactivity Language, paclet:guide/DynamicInteractivityLanguage])}, {▪(RefLinkPlain[Notebook Document Generation, paclet:guide/DocumentGeneration])}, {▪(RefLinkPlain[Creating Inspectors, paclet:guide/CreatingInspectors])}, {▪(RefLinkPlain[Custom Interface Construction, paclet:guide/CustomInterfaceConstruction])}, {▪(RefLinkPlain[Toolbars, paclet:guide/Toolbars])}})}})