SweetUI

Search items

Jump to an item

block

nutrition-overview

Composes energy, macro values; embeddable.

nutritionhealthdashboardoverviewmacronutrients
nutrition-overview, light

On iPad

The same installed source at a regular width. It adapts its layout without a separate design.

nutrition-overview on iPad, light

Install

With the sweetui tool (brew install mangobyte-dev/tap/sweetui):

sweetui install nutrition-overview --destination Sources/YourFeature/Components

Installs in order: metric-card 0.2.2, macro-progress 0.4.1, nutrition-overview 0.2.3. Point --destination at a folder inside the consuming target's sources.

Usage

NutritionOverview(
    "Today",
    energyTitle: "Energy",
    energy: Text("1,640 kcal"),
    energyDetail: Text("360 kcal remaining"),
    sectionTitle: "Macronutrients",
    macros: [
        NutritionMacroItem(
            id: "protein",
            name: "Protein",
            value: Text("96 g"),
            target: Text("130 g"),
            progress: 96.0 / 130.0,
            systemImage: "fish.fill",
            tint: .indigo
        )
    ],
    actionTitle: "Log food",
    onLogFood: {}
)

Accessibility contract

  • Button, ProgressView semantics; header-trait titles.
  • System text, adaptive rows: Dynamic Type; prepared values: caller localization/format.

Details

Kindblock
Version0.2.3
PlatformsiOS 26.0+
Dependenciesmetric-card, macro-progress
SourceRegistry/sources/blocks/NutritionOverview.swift
Xcode previewNutrition Overview