# Checkbox (/examples/widgets/checkbox)



Checkbox states stacked vertically [#checkbox-states-stacked-vertically]

<LvglExampleBrief>
  Four labelled checkboxes covering default, checked, disabled, and multi-line variants.
</LvglExampleBrief>

The active screen uses `LV_FLEX_FLOW_COLUMN` with start alignment and holds
four checkboxes: `Apple` in the default state, `Banana` with
`LV_STATE_CHECKED`, `Lemon` with `LV_STATE_DISABLED`, and
`Melon\nand a new line` with both checked and disabled states and a
two-line label. A shared `LV_EVENT_ALL` callback logs the checkbox text
and its current checked state on `LV_EVENT_VALUE_CHANGED`.

<LvglExample name="lv_example_checkbox_1" path="widgets/checkbox/lv_example_checkbox_1" />

Checkboxes as radio buttons [#checkboxes-as-radio-buttons]

<LvglExampleBrief>
  A group of five checkboxes where only one can be checked at a time.
</LvglExampleBrief>

A centered flex-column container holds five checkboxes labelled
`Radio button 1` through `Radio button 5`. Each one calls
`lv_obj_set_radio_button(obj, true)` so checking one clears the others,
and two `LV_PART_INDICATOR` styles round the indicator with
`LV_RADIUS_CIRCLE` and clear the default checkmark image in
`LV_STATE_CHECKED`. Each checkbox logs its label and selection state on
`LV_EVENT_VALUE_CHANGED`.

<LvglExample name="lv_example_checkbox_2" path="widgets/checkbox/lv_example_checkbox_2" />
