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.
201elements
ConcentricRectangle
Uniform Concentric Rectangle
Create a rectangle with the same corner style set on four corners.
Explore Uniform Concentric Rectangle on iPhone in portrait, with SwiftUI code and Apple API documentation.
SwiftUI code
ZStack(alignment: .bottom) {
// Respects the device frame's corner radius
ConcentricRectangle(corners: .concentric, isUniform: true)
.fill(Color.blue)
.frame(height: 50)
.frame(maxHeight: .infinity, alignment: .bottom)
.padding(30)
.ignoresSafeArea()
ZStack {
// Gets radius from parent rect
ConcentricRectangle()
.fill(.secondary)
// Respects the parent rectangle's corner radius
ConcentricRectangle(corners: .concentric, isUniform: true)
.fill(.red)
.frame(width: 200, height: 200)
.padding([.trailing, .bottom])
}
.containerShape(
.rect(cornerRadius: 42)
)
.frame(width: 250, height: 250)
.padding(.bottom)
}Compatibility
iOS 26.0+ iPadOS 26.0+ macOS 26.0+ watchOS 26.0+ tvOS 26.0+ visionOS 26.0+
Tags
Found an issue or have a suggestion?
All variants
Every available iPhone screenshot for Uniform Concentric Rectangle.