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.

Element structs, [WidgetConfig]/[WidgetElement], builders, and tests live here; shared style values are in [style] and data payloads ([ChartDataPoint], [ListItem], [CanvasDrawCommand]) are in [data].

Structs§

BorderConfig
Border color and width.
ButtonElement
Tappable button that opens a URL or emits widget-action.
CanvasElement
Declarative canvas — draw arbitrary shapes via JSON commands.
ChartDataPoint
A single labeled data point for crate::models::ChartElement.
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
Explicit width / height / max-size constraints for an element.
GaugeElement
Circular or capacity-style gauge.
GradientConfig
Linear, radial, or angular gradient background.
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
A single row for crate::models::ListElement.
ProgressElement
Linear or circular progress indicator.
ShadowConfig
Drop shadow configuration.
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
A single declarative draw command for crate::models::CanvasElement.
ChartType
Chart kind.
ClipShape
Clip shape for content masking.
ColorValue
Color value — hex string, semantic name, or adaptive { light, dark } pair.
ContentMode
How an image fills its frame.
DateStyle
Date / relative-time display style.
FontDesign
Font design (default, monospaced, rounded, serif).
FontWeight
Font weight.
FrameDimension
A frame dimension — either a fixed point value or "infinity".
GaugeStyle
Gauge visual style.
GradientDirection
Direction for linear gradients.
GradientType
Gradient shape.
HorizontalAlignment
Horizontal alignment of children within a stack.
PaddingValue
Inset padding — a single uniform value or per-edge overrides.
ProgressStyle
Progress indicator style.
ShapeType
Shape kind for crate::models::ShapeElement.
TextAlignment
Text alignment within the line.
TextStyle
Semantic text style — respects Dynamic Type / accessibility settings.
TimerCounting
Countdown/countup direction for crate::models::TimerElement.
VerticalAlignment
Vertical alignment of children within a stack.
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.