optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
params
yes
table
Field
Type
Description
x
number
position relative to the top-left of the parent
y
number
position relative to the top-left of the parent
w
number
width
h
number
height
color
color or function
primary color for the object
pos
function
dynamic position callback returning x, y
size
function
dynamic size callback returning w, h
visible
function
dynamic visibility callback
floating
boolean
keep the object fixed inside a scrollable container, added in 2.11.6, defaults to false
text
string or function
text displayed in the button, defaults to an empty string
press
function
called when the user taps the button, after releasing ENTER or the screen; may optionally return a non-zero integer to display the button in the checked state, defaults to nil
longpress
function
called on a long tap; may optionally return a non-zero integer to display the button in the checked state, defaults to nil
active
function
sets the enabled/disabled state; must return a boolean, true to enable, defaults to nil
checked
boolean
sets the initial checked state; can be updated with lvgl.set(), defaults to false
color
color or function
background color, defaults to the EdgeTX button style PRIMARY2 theme color
textColor
color or function
text color, defaults to the EdgeTX button style SECONDARY1 theme color
cornerRadius
number
radius for the button's corners, defaults to the EdgeTX button style radius
font
font value or function
sets the font size, e.g. MIDSIZE, DBLSIZE; defaults to STDSIZE