---
title: "cornerRadius(_:antialiased:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/cornerradius(_:antialiased:)"
---

# cornerRadius(_:antialiased:)

Clips this view to its bounding frame, with the specified corner radius.

## Declaration

```swift
nonisolated func cornerRadius(_ radius: CGFloat, antialiased: Bool = true) -> some View

```

## Parameters

- `radius`: A CGFloat value that specifies the corner radius to use when clipping the view to its bounding frame.
- `antialiased`: A Boolean value that indicates whether the rendering system applies smoothing to the edges of the clipping rectangle.

## Return Value

Return Value A view that clips this view to its bounding frame with the specified corner radius.

## Discussion

Discussion By default, a view’s bounding frame only affects its layout, so any content that extends beyond the edges of the frame remains visible. Use cornerRadius(_:antialiased:) to hide any content that extends beyond these edges while applying a corner radius. The following code applies a corner radius of 25 to a text view: Text("Rounded Corners")     .frame(width: 175, height: 75)     .foregroundColor(Color.white)     .background(Color.black)     .cornerRadius(25)

## See Also

### Graphics and rendering modifiers

- [accentColor(_:)](swiftui/view/accentcolor(_:).md)
- [mask(_:)](swiftui/view/mask(_:).md)
- [animation(_:)](swiftui/view/animation(_:)-1hc0p.md)
