Spinbox (lv_spinbox)

A numeric editor built on a Text Area with fixed decimals and step.

Overview

The Spinbox is a numeric editor built on a Text Area. It shows an integer with an optional fixed decimal point and digit count, and the value can be stepped within a range.

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 background and the number text (extends lv_textarea): background, padding and text properties.
scrollbarThe scrollbar shown when content overflows: width (thickness), background properties and padding.
selectedThe selected text. Only text_color and bg_color are used.
cursorThe cursor over the edited digit: bg_color/bg_opa for a block cursor or a left border for a bar cursor.

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

PropertyTypeDescription
valueintSet the value as a raw integer. The displayed format depends on digit_count and dec_point_pos
rolloverboolIf enabled, stepping past the maximum jumps to the minimum and vice versa
digit_countintSet the number of digits, excluding the sign and the decimal separator
dec_point_posintSet the number of digits before the decimal point. 0 means no decimal point is shown
min_valueintSet the minimum value (inclusive)
max_valueintSet the maximum value (inclusive)
stepintSet the digit that changes on increment/decrement. Can be 1, 10, 100, etc.
bind_valuesubjectConnect a subject to the spinbox's value

Last updated on

On this page