iPhone SwiftUI layouts

Explore SwiftUI APIs, components, and modifiers with interactive iPhone previews, Swift code, and Apple documentation. Compare every available orientation, appearance, and design.

Color

Color Variants

HierarchicalShapeStyle, a shape style that maps to one of the numbered content styles

Explore Color Variants on iPhone in portrait, with SwiftUI code and Apple API documentation.

VStack {
  HStack {
    smallRect
      .foregroundStyle(.blue)
    smallRect
      .foregroundStyle(.blue.secondary)
    smallRect
      .foregroundStyle(.blue.tertiary)
    smallRect
      .foregroundStyle(.blue.quaternary)
    smallRect
      .foregroundStyle(.blue.quinary)
  }
  HStack {
    smallRect
      .foregroundStyle(.red)
    smallRect
      .foregroundStyle(.red.secondary)
    smallRect
      .foregroundStyle(.red.tertiary)
    smallRect
      .foregroundStyle(.red.quaternary)
    smallRect
      .foregroundStyle(.red.quinary)
  }
  HStack {
    smallRect
      .foregroundStyle(.orange)
    smallRect
      .foregroundStyle(.orange.secondary)
    smallRect
      .foregroundStyle(.orange.tertiary)
    smallRect
      .foregroundStyle(.orange.quaternary)
    smallRect
      .foregroundStyle(.orange.quinary)
  }
  // ...
}
iOS 15.0+ iPadOS 15.0+ macOS 12.0+ watchOS 8.0+ tvOS 15.0+ visionOS 1.0+

Every available iPhone screenshot for Color Variants.

1 views