Skip to content
Skeleton Stat preview
Rendered from the SwiftUI source on this page.

Skeleton Stat

From syxUI — written for both platforms, not translated between them.

Stat-card skeletons.

Loaders · SwiftUI · iOS 17

  • loaders
  • swiftui

The actual source

SkeletonStat.swift
// Skeleton Stat · syxUI · https://syxui.dev/components/loader-sk-stat
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

func sk(_ w: CGFloat, _ h: CGFloat) -> some View { RoundedRectangle(cornerRadius: 5, style: .continuous).fill(Color.primary.opacity(0.08)).frame(width: w, height: h) }

struct SkeletonStat: View { var body: some View { HStack(spacing: 12) { ForEach(0..<2, id: \.self) { _ in VStack(alignment: .leading, spacing: 8) { sk(50, 10); sk(80, 20); RoundedRectangle(cornerRadius: 5).fill(Color.primary.opacity(0.08)).frame(height: 30) }.padding(14).frame(maxWidth: .infinity, alignment: .leading).background(Color.primary.opacity(0.03), in: RoundedRectangle(cornerRadius: 14, style: .continuous)) } }.frame(width: 300) } }
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17