Skip to main content
161

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Apple docs
WidgetKitApple

Widget compact stat

Compose a compact WidgetKit label and value with optional semantic icon.

Public APILumenWidgetCompactStatApple / SwiftUISwift product: LumenWidgetUI

Apple availability

Supported native targets

Import LumenWidgetUI in the target that uses this component. iPad support follows the iOS package baseline and uses native iPad layout behavior.

iPhone · iOS 16+iPad · iPadOS 16+Mac · macOS 13+Apple Watch · watchOS 9+

Native example

Use Widget compact stat

Use for one compact label and value pair. Keep charts, timelines, and domain formatting application-owned.

Focused package reference

This API ships in LumenWidgetUI. No application-playground capture is published for this extension-only product yet.

swift
LumenWidgetCompactStat(
    label: .verbatim("Duration"),
    value: .verbatim("01:15"),
    iconSystemName: "timer"
)

Reference

Public API

The primary shared and platform-specific options exposed by LumenWidgetCompactStat.

APIValues or typeDefaultDescription
labelLumenWidgetTextContentRequiredNames the metric.
valueLumenWidgetTextContentRequiredProvides the formatted metric value.
iconSystemNameString?nilAdds a decorative semantic symbol.
toneLumenWidgetToneaccentSelects the value tone.

Native behavior

Design and accessibility

When to use it

Use for one compact label and value pair. Keep charts, timelines, and domain formatting application-owned.

Accessibility

Label and value combine as one readable metric while native semantic fonts preserve accessibility text scaling.

Apple docsSwiftUI package