Checkbox (lv_checkbox)

A tick box with a label that toggles when clicked.

Overview

The Checkbox combines a tick box with a label. Clicking it toggles the checked state. The text is set directly on the widget and the tick box reflects the checked and disabled states.

Learn more in the LVGL Open documentation.

Properties

Parts

Style parts of the widget with local style (e.g. style_bg_color-knob="0xff0000") or with style sheets (e.g. <style name="style_knob" selector="knob">). See Styles to learn more.

PartDescription
mainThe label and its area: text properties; pad_column sets the gap between the tick box and the text.
indicatorThe tick box: background, border, shadow and padding properties. bg_image_src sets the check icon. Use the 'checked' state (e.g. indicator|checked) for the checked look.

Properties below are the widget's XML <api>; see API for how properties, parameters and elements work.

PropertyTypeDescription
textstringThe label text shown next to the checkbox

Last updated on

On this page