Skip to main content

Checkbox

The Checkbox widget is a selection widget that toggles between two states, on and off. Use it for terms-of-service consent, multi-select lists, and similar cases.

info

Example file: 07_Work_with_Widgets/checkbox_objet.lfp

Definition and role

The Checkbox widget draws a square check area, and tapping it animates the switch between checked and unchecked. Every state change runs the onChanged action. Set the size, colors, and border.

  • Category: Contents (input and selection)
  • Default state: off (unchecked)

Features

FeatureDescription
Two-state toggleTapping switches between checked and unchecked, with a transition animation.
Change detectiononChanged runs whenever the state changes and passes the new value.
Appearance settingsAdjusts the size, border, checked and unchecked background colors, and check mark color.

How to use

  1. Open the Contents category in the left widget palette.
  2. Drag and drop the Checkbox item onto the canvas.
  3. Set the initial state (value), the size, and the colors in the Properties panel.
  4. Connect the action to run on a state change to onChanged.

Properties

PropertyDescriptionDefaultValue / type
valueWhether the box is checked (initial state)Off (false)True / false
sizeCheckbox size30Number (px)
borderColorBorder color#666666Color
borderWidthBorder thickness1Number (0 or greater)
borderRadiusCorner radius0Number
activeColorBackground color when checked#00AAFFColor
inactiveColorBackground color when unchecked#FFFFFFColor
checkColorCheck mark (✔) color#FF0000Color
unCheckColorUnchecked mark colorTransparentColor

Notes and tips

tip

The action connected to onChanged receives the state value after the change — true or false.

tip

Style the checked state with both activeColor (the background) and checkColor (the ✔ mark).

Learn more

tip

For the full set of Widget Control items (Property, Method, and Event) that script this widget, visit Checkbox Widget Control.