how do I create a concentric round shape in SwiftUI?

Asked on 2025-07-10

@wwdc25

1 search

To create a concentric round shape in SwiftUI, you can use the concept of concentricity, which is discussed in the session "Build a SwiftUI app with the new design" from WWDC 2025. The session explains how to use a concentric rectangle shape to maintain concentricity with a container. You can pass the container concentric configuration to the corner parameter of a rectangle, and the shape will automatically match its container across different displays and window shapes.

For a round shape, you might consider using a capsule or a circle, depending on your specific needs. Capsules naturally support concentricity, as they use a radius that's half the height of their container, which is why they are commonly used throughout the system for elements like sliders and switches.

If you want to learn more about how to implement this in your SwiftUI app, you can refer to the session Build a SwiftUI app with the new design (00:17:29).

how do I create a concentric round shape in SwiftUI? | Ask WWDC