label

The label component is a customizable label widget with animation and event handling capabilities. It allows hover, focus, and text styling via various properties, animations, and events.

Examples

Basic Usage

1<label text="'Hello World'" font_size="16.0" color="#FFF"> </label>

About font family

Use the built-in dep function

1<label
2  text="'Hello World'"
3  font_family="dep('crate://self/path/to/font/family')"
4>
5</label>

Properties

NameDescriptionType
themeThemeThemes
colorColorMakepadColor
stroke_hover_colorFont color when hoveringMakepadColor
stroke_focus_colorFont color when getting focusMakepadColor
font_sizeFont sizeF64
cursorMouse cursorMouseCursor
line_spacingLine spacingF64
height_factorHeight factorF64
wrapText wrapping methodTextWrap
font_familyFont typeLiveDependency
visibleVisible or notbool
heightheightSize
widthwidthSize
marginmarginMargin
paddingpaddingPadding
alignalignmentAlign
texttext contentString
animation_keywhether to allow animationbool
event_keywhether to allow eventsbool
grabKey_focuswhether to capture key focusbool

Event callback

NameDescriptionParameters
hover_inmouse enter eventGLabelHoverParam
hover_outmouse leave eventGLabelHoverParam
focusget focus eventGLabelFocusParam
focus_lostFocus lost eventGLabelFocusLostParam