Widgets

Overview of the HWWidget building blocks.

Widgets

HWWidget is the base class for the layout primitives you compose inside @HomeWidget(widget: ...). They translate to SwiftUI on iOS and Jetpack Glance on Android at generation time.

Layout

WidgetPurpose
HWColumnVertical stack of children.
HWRowHorizontal stack of children.
HWPaddingInset a child by an HWEdgeInsets.
HWFillExpand a child to fill the available space.

Content

WidgetPurpose
HWTextFixed or data-bound text.
HWColoredBoxSolid background color around a child.
HWDecoratedBoxBackground color and/or border around a child.

Branching

WidgetPurpose
HWAdaptivePick a different child per platform.
HWConditionalPick a child based on a runtime data check.

Data only

WidgetPurpose
HWDataOnlyDeclare data fields without rendering anything.

See Data Types for the available HWDataType variants you can bind to widgets.