Widget Properties
All
These properties apply to all widgets, and can be used on every widget!
Properties
class:stringcss class namevalign:stringhow to align this vertically. possible values: "fill", "baseline", "center", "start", "end"halign:stringhow to align this horizontally. possible values: "fill", "baseline", "center", "start", "end"vexpand:boolshould this container expand vertically. Default: falsehexpand:boolshould this widget expand horizontally. Default: falseeval_ignore:boolskip the automatic re-evaluation of this widget.width:intwidth of this elementheight:intheight of this elementactive:boolIf this widget can be interacted withtooltip:stringtooltip text (on hover)visible:boolvisibility of the widgetstyle:stringinline scss style applied to the widgetcss:stringscss code applied to the widgetcan_target:boolmake the widget targettable to pointer events.focusable:boolmake widget focusablewidget_name:stringcustom widget name
ComboBoxText
Properties
items:vecItems displayed in the combo boxtimeout:durationtimeout of the command. Default: "200ms"onchange:stringruns when an item is selected, replacing{}with the item
Expander
Properties
name:stringname of the expanderexpanded:boolsets whether it's expanded
Revealer
Properties
transition:stringanimation name ("slideright", "slideleft", etc.)reveal:boolwhether the child is revealedduration:durationhow long the transition lasts. Default: "500ms"
Checkbox
Properties
checked:boolinitial checked statetimeout:durationcommand timeout. Default: "200ms"onchecked:stringcommand when checkedonunchecked:stringcommand when unchecked
ColorButton
Properties
use_alpha:booluse alpha channelonchange:stringcommand on color selecttimeout:durationDefault: "200ms"
ColorChooser
Properties
use_alpha:booluse alpha channelonchange:stringcommand on color selecttimeout:durationDefault: "200ms"
Scale
Properties
flipped:boolreverse directionmarks:stringdraw marksdraw_value:boolshow valuevalue_pos:stringwhere to show value ("left", "right", etc.)round_digits:intnumber of decimal placesvalue:floatcurrent valuemin:floatminimum valuemax:floatmaximum valuetimeout:durationDefault: "200ms"onchange:stringcommand on change (use{}for value)orientation:stringlayout direction
Progress
Properties
text: text to show over the progressshow_text: whether to show the textflipped:boolreverse directionvalue:floatprogress (0–100)orientation:stringlayout direction
CircularProgress
Properties
value:floatthe progression value, between (0-100)start_at:floatthe percentage that the circle should start atthickness:floatthe thickness of the circleclockwise:boolwether the progress bar spins clockwise or counter clockwisefg_color:stringforeground color of circlebg_color:stringbackground color of circle
Input
Properties
value:stringset current textplaceholder:stringset a placeholder textonchange:stringcommand on change (use{}for value)timeout:durationDefault: "200ms"onaccept:stringcommand on Enter (use{}for value)password:boolobscure input
Button
Properties
label:stringlabel to show on the buttontimeout:durationDefault: "200ms"onclick:stringcommand on activationonmiddleclick:stringcommand on middle clickonrightclick:stringcommand on right click
Image
Properties
path:stringimage file pathcontent_fit:stringhow the image should fit ("fill", "contain", "cover", "scaledown")can_shrink:boolwhether the image can shrink or notimage_width:intimage widthimage_height:intimage heightpreserve_aspect_ratio:boolkeep aspect ratiofill_svg:stringfill color for SVGs
Box
Properties
spacing:intspacing between childrenorientation:stringdirection of childrenspace_evenly:booldistribute children evenly
Overlay
Properties
None
Tooltip
Properties
None listed
Scroll
Properties
hscroll:boolallow horizontal scrollingvscroll:boolallow vertical scrollingpropagate_natural_height:booluse the natural height if true
EventBox
Properties
orientation:stringlayout directionspacing:intspacing between childrenspace_evenly:booldistribute children evenlytimeout:durationDefault: "200ms"onscroll:stringcommand on scroll ({}becomes direction)onhover:stringcommand on hoveronhoverlost:stringcommand on hover exitcursor:stringcursor typeondropped:stringcommand on drop ({}is URI)dragvalue:stringURI to drag from this widgetdragtype:stringtype to drag ("file", "text")onclick:stringcommand on clickonmiddleclick:stringcommand on middle clickonrightclick:stringcommand on right clickonkeypress:stringcommand on any key press ({}becomes the id of the key pressed)onkeyrelease:stringcommand on any key release ({}becomes the id of the key released)
Label
Properties
text:stringtext to displaytruncate:booltruncate textlimit_width:intmax characters to showtruncate_left:booltruncate beginningshow_truncated:boolshow truncationunindent:boolstrip leading spacesmarkup:stringPango markupwrap:boolwrap textgravity:stringtext gravityxalign:floathorizontal alignmentyalign:floatvertical alignmentjustify:stringtext justificationwrap_mode:stringwrap mode ("word", "char", etc.)lines:intmax lines (−1 = unlimited)
Calendar
Properties
day:floatselected daymonth:floatselected monthyear:floatselected yearshow_heading:boolshow headingshow_day_names:boolshow day namesshow_week_numbers:boolshow week numbersonclick:stringcommand with{0},{1},{2}for day/month/yeartimeout:durationDefault: "200ms"
Stack
Properties
selected:intchild indextransition:stringanimation nametransition_duration:intduration in millisecond as number
FlowBox
Properties
orientation:stringlayout directionspace_evenly:booldistribute children evenlyonaccept:stringcommand on Enter (use{}for selected widget's name)selection_model:stringselection model
Graph
Properties
value:floatcurrent valuetype:stringgraph type. possible values: "line" (default), "step-line", "fill", "step-fill"time_range:durationthe range of time to show. Default: "10s"min:floatminimum valuemax:floatmaximum valuedynamic:boolwhether the y range should dynamically change based on value. Default: trueanimate:boolenable smooth scrolling. Default: trueflip_x:boolflip the graph horizontally. Default: falseflip_y:boolflip the graph horizontally. Default: falsevertical:boolif set to true, the x and y axes will be exchanged. Default: falsethickness:floatthe thickness of the line (for line charts). Default: 1.0line_style:stringchanges the look of the edges in the graph (for line charts). possible values: "miter" (default), "bevel", "round"