Basic Widgets

Core UI elements for building interfaces. These widgets form the foundation of every PyHMI application.

Theming: instead of setting colors on each widget, apply a theme file (.pyhmt) that defines accent, text and background colors plus font size and corner radius for whole widget classes. See the Theming guide.
Label

Static text display with configurable font, size, color, and alignment.

  • text: string
  • fontSize: int
  • color: color
  • alignment: enum
Button

Push button with text or image. Supports primary and secondary variants.

  • text: string
  • variant: enum
  • enabled: bool
  • onClicked: signal
CheckBox

Binary toggle control. Supports tristate mode.

  • checked: bool
  • text: string
  • tristate: bool
  • onToggled: signal
RadioButton

Exclusive selection within a group. Only one radio button can be selected at a time.

  • selected: bool
  • text: string
  • group: string
  • onChanged: signal
Switch

Toggle switch with animated knob. On/off state indicator.

  • checked: bool
  • text: string
  • onToggled: signal
Slider

Continuous value control with draggable knob. Supports min/max range.

  • value: float
  • min: float
  • max: float
  • onValueChanged: signal
ProgressBar

Linear progress indicator. Determinate or indeterminate mode.

  • value: float
  • min: float
  • max: float
Dial

Circular rotary control. Maps rotation angle to a numeric value.

  • value: float
  • min: float
  • max: float
  • onValueChanged: signal
TextField

Single-line text input with placeholder, validation, and keyboard support.

  • text: string
  • placeholder: string
  • inputMode: enum
  • onEditingFinished: signal
Image

Image display with auto-scaling. Supports PNG, BMP, GIF formats.

  • source: string
  • fillMode: enum
  • premultiplied: bool
DropDown

Collapsible selection list. Displays current selection and expands on click.

  • model: list
  • currentIndex: int
  • currentText: string
  • onActivated: signal
Rotary

Rotary knob control. Maps rotation angle to numeric value with arc indicator.

  • value: float
  • min: float
  • max: float
  • onValueChanged: signal
TableView

Multi-column data table with headers. Sortable columns with row selection.

  • model: list
  • columns: list
  • selectionMode: enum
TreeView

Hierarchical tree with expandable nodes. Parent-child relationships.

  • model: list
  • rootVisible: bool
  • onItemClicked: signal