Widget Properties
widget
These properties apply to all widgets, and can be used anywhere!
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: falsewidth: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:strongcustom widget name
combo_box_text
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
color_button
Properties
use_alpha:booluse alpha channelonchange:stringcommand on color selecttimeout:durationDefault: "200ms"
color_chooser
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
flipped:boolreverse directionvalue:floatprogress (0–100)orientation:stringlayout direction
input
Properties
value:stringset current textonchange:stringcommand on change (use{}for value)timeout:durationDefault: "200ms"onaccept:stringcommand on Enter (use{}for value)password:boolobscure input
button
Properties
timeout:durationDefault: "200ms"onclick:stringcommand on activationonmiddleclick:stringcommand on middle clickonrightclick:stringcommand on right click
image
Properties
path:stringimage file pathimage_width:intimage widthimage_height:intimage heightpreserve_aspect_ratio:boolkeep aspect ratiofill_svg:stringfill color for SVGs
icon
Properties
path:stringimage file pathimage_width:intimage widthimage_height:intimage heightpreserve_aspect_ratio:boolkeep aspect ratiofill_svg:stringfill color for SVGsicon:stringtheme icon name
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 name
flowbox
Properties
orientation:stringlayout directionspace_evenly:booldistribute children evenlyonaccept:stringcommand on Enter (use{}for selected widget's name)selection_model:stringselection model