Text Area (lv_textarea)

An editable text input with a cursor; supports one-line and password modes.

Overview

The Text Area is an editable text input with a cursor. It wraps long lines, can scroll, and supports one-line and password modes plus character and accepted-list filtering.

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 typed text: background, padding and text properties.
scrollbarThe scrollbar shown when the text is taller than the area: width (thickness), background properties and padding on the respective side.
selectedThe selected text. Only text_color and bg_color are used.
cursorThe insertion cursor: set bg_color/bg_opa for a block cursor or a left border (border_side='left') for a bar cursor. anim_duration controls blinking.
textarea_placeholderThe placeholder text shown when empty: text properties (e.g. text_color, text_font).

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

PropertyTypeDescription
textstringSet textarea text
placeholder_textstringSet placeholder text
one_lineboolEnable single-line mode
password_modeboolEnable password masking
password_show_timeintSet delay to show typed chars (ms)
text_selectionboolEnable text selection
cursor_posintSet cursor position (0-based)

Last updated on

On this page