ConcentricRectangle
ConcentricRectangle is a concentric rectangle shape view introduced in iOS 26+. It is designed to create rectangles with progressively inset (concentric) corner geometry, which adapts naturally to modern UI designs.
It is especially suitable for:
- Glass-style buttons
- Card backgrounds
- Interactive clipping regions
- Glass transition masks
- Layered container UI
In Scripting, ConcentricRectangle can be used both as:
-
A standalone Shape view
-
A specialized shape inside:
clipShapebackgroundcontentShape
1. ConcentricRectangle Core Definition
Description
-
ConcentricRectangleis a standard Shape component -
Supports:
- Fill
- Stroke
- Trimmed paths
- Advanced corner distribution via
ConcentricRectangleShape
-
Always renders inside the parent view’s frame
-
Available on iOS 26 and later only
2. Corner Style System: EdgeCornerStyle
The core visual behavior of ConcentricRectangle is controlled through EdgeCornerStyle, which defines how each corner behaves.
2.1 Fixed Corner Style
Used to create traditional fixed-radius rounded corners.
This mode is appropriate for classic static cards and buttons.
2.2 Concentric Corner Style
Creates a dynamically inset concentric corner effect.
Recommended for:
- Glass-style controls
- Dynamic cards
- Layered UI surfaces
- Animated masking effects
2.3 Shorthand Mode
Equivalent to:
3. ConcentricRectangleShape (Corner Distribution Rules)
ConcentricRectangleShape defines how corner styles are distributed across all four corners.
It supports seven structural configuration patterns.
3.1 Uniform Corners (Most Common)
Example:
3.2 Fully Independent Corners
Used for:
- Asymmetric cards
- Special edge treatments
- Adaptive container layouts
3.3 Uniform Bottom Corners
Typical for bottom sheets and lifted panels.
3.4 Uniform Top Corners
Typical for modal headers and floating top panels.
3.5 Uniform Top and Bottom
3.6 Uniform Leading Corners
3.7 Uniform Leading and Trailing
4. Shared Shape Properties (ShapeProps)
4.1 trim (Path Trimming)
Used for:
- Progressive path animations
- Partial rendering effects
- Stroke-only transitions
4.2 fill (Shape Fill)
Supports:
- Solid colors
- System materials
- Gradient styles
4.3 stroke (Outline Rendering)
5. Using ConcentricRectangle in View Modifiers
5.1 As clipShape
Example:
Used for:
- Actual visual clipping
- Glass transition masking
- Blur boundary control
5.2 As background
Example:
5.3 As contentShape (Hit Testing Area)
Defines the interactive region for:
- Taps
- Gestures
- Hover detection
- Drag operations
6. Full Example Breakdown
This configuration produces:
- A fixed-radius outer container
- A concentric inner rectangle
- A layered depth effect between the two shapes
- A visually emphasized inner hierarchy via red fill
7. Design and Implementation Notes
-
minimumshould never exceed half of the smallest side of the container. -
Concentric corner styles work best when combined with:
- Glass material
- Blur
- Opacity layering
-
When used as
contentShape, it only affects hit-testing, not rendering. -
When used as
clipShape, it physically clips the rendered content. -
Nested
ConcentricRectanglelayers create stronger depth cues than uniform rounded rectangles.
