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.
| Part | Description |
|---|---|
main | The background and the typed text: background, padding and text properties. |
scrollbar | The scrollbar shown when the text is taller than the area: width (thickness), background properties and padding on the respective side. |
selected | The selected text. Only text_color and bg_color are used. |
cursor | The 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_placeholder | The 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.
| Property | Type | Description |
|---|---|---|
text | string | Set textarea text |
placeholder_text | string | Set placeholder text |
one_line | bool | Enable single-line mode |
password_mode | bool | Enable password masking |
password_show_time | int | Set delay to show typed chars (ms) |
text_selection | bool | Enable text selection |
cursor_pos | int | Set cursor position (0-based) |
Last updated on