Interactive previews iPhone
Materials
All materials
Platform Compatibility
iOS 15.0+ iPadOS 15.0+ macOS 12.0+ watchOS 8.0+ tvOS 15.0+ visionOS 1.0+
Tags
SwiftUI Code
VStack {
HStack {
HStack {
smallRect
.foregroundStyle(.ultraThinMaterial)
smallRect
.foregroundStyle(.thinMaterial)
smallRect
.foregroundStyle(.regularMaterial)
smallRect
.foregroundStyle(.thickMaterial)
smallRect
.foregroundStyle(.ultraThickMaterial)
}
}
.padding()
.background {
meshGradient
}
HStack {
HStack {
smallRect
.foregroundStyle(.ultraThinMaterial)
smallRect
.foregroundStyle(.thinMaterial)
smallRect
.foregroundStyle(.regularMaterial)
smallRect
.foregroundStyle(.thickMaterial)
smallRect
.foregroundStyle(.ultraThickMaterial)
}
}
.padding()
.padding(.horizontal)
.background {
Image(.cats)
.resizable()
.aspectRatio(contentMode: .fill)
.frame(height: 50)
.padding()
.clipped()
}
}Found an issue or have a suggestion?
Created: May 30, 2025Updated: May 30, 2025
Explore Other Components
Browse allCustom Slider Ticks
Creates a slider to select a value from a given range, subject to a step increment, which displays the provided labels and customizable ticks.
ContainerRelativeShape
A shape that is replaced by an inset version of the current container shape. If no container shape was defined, is replaced by a rectangle