Skip to main content

Module models

Module models 

Source
Expand description

Widget IR models (WidgetConfig, WidgetElement, …).

Element structs and their fields carry rustdoc used by schemars / docs site. Widget IR types: [WidgetConfig], [WidgetElement], and shared style values.

Structs§

BorderConfig
ButtonElement
Tappable button that opens a URL or emits widget-action.
CanvasElement
Declarative canvas — draw arbitrary shapes via JSON commands.
ChartDataPoint
ChartElement
Bar, line, area, or pie chart.
ContainerElement
Single-child wrapper for cards, badges, and overlays.
DateElement
Formatted date / relative time display.
DividerElement
Horizontal or vertical rule.
ElementStyle
Shared visual style applied to any element (padding, background, frame, …).
FrameConfig
GaugeElement
Circular or capacity-style gauge.
GradientConfig
GridElement
Fixed-column grid of children.
HStackElement
Horizontal stack of children.
ImageElement
Image from SF Symbol / drawable name, base64 data, or URL.
LabelElement
Convenience element combining an SF Symbol / icon with text.
LinkElement
Tappable wrapper — makes nested content clickable.
ListElement
Collection list of rows (text, optional checked marker and action).
ListItem
ProgressElement
Linear or circular progress indicator.
ShadowConfig
ShapeElement
Colored shape — circle, capsule, or rectangle.
SpacerElement
Flexible empty space.
TextElement
Text label with optional semantic typography.
TimerElement
Live countdown/countup timer that updates without timeline refresh.
ToggleElement
On/off toggle control.
VStackElement
Vertical stack of children.
WidgetConfig
Top-level widget config with layouts per size family.
WidgetWindowConfig
Configuration for creating a desktop widget window.
ZStackElement
Overlay stack — children layered on top of each other.

Enums§

BackgroundValue
Background: solid color string, adaptive pair, gradient, or material blur.
CanvasDrawCommand
ChartType
ClipShape
Clip shape for content masking.
ColorValue
Color value — hex string, semantic name, or adaptive { light, dark } pair.
ContentMode
DateStyle
FontDesign
FontWeight
FrameDimension
GaugeStyle
GradientDirection
GradientType
HorizontalAlignment
PaddingValue
ProgressStyle
ShapeType
TextAlignment
TextStyle
Semantic text style — respects Dynamic Type / accessibility settings.
TimerCounting
VerticalAlignment
WidgetElement
A UI element that can be a layout container or a leaf widget.

Functions§

hstack
Build an HStackElement with the given children.
text
Build a TextElement with the given content.
vstack
Build a VStackElement with the given children.