<!--
{
  "availability" : [
    "iOS: 13.0.0 - 27.0.0",
    "iPadOS: 13.0.0 - 27.0.0",
    "macCatalyst: 13.0.0 - 27.0.0",
    "macOS: 10.15.0 - 27.0.0",
    "tvOS: 13.0.0 - 27.0.0",
    "visionOS: 1.0.0 - 27.0.0",
    "watchOS: 6.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/cornerRadius(_:antialiased:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE12cornerRadius_11antialiasedQr14CoreFoundation7CGFloatV_SbtF"
  },
  "title" : "cornerRadius(_:antialiased:)"
}
-->

# cornerRadius(_:antialiased:)

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

```
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

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

## 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)
```

![A screenshot of a rectangle with rounded corners bounding a text](images/com.apple.SwiftUI/SwiftUI-View-cornerRadius@2x.png)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)