<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/ButtonBorderShape/roundedRectangle(radius:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI17ButtonBorderShapeV16roundedRectangle6radiusAC14CoreFoundation7CGFloatV_tFZ"
  },
  "title" : "roundedRectangle(radius:)"
}
-->

# roundedRectangle(radius:)

A rounded rectangle shape.

```
static func roundedRectangle(radius: CGFloat) -> ButtonBorderShape
```

## Parameters

`radius`

The corner radius of the rectangle.

## Discussion

Use the [`buttonBorderShape(_:)`](/documentation/SwiftUI/View/buttonBorderShape(_:)) view modifier to apply the shape
to bordered buttons within a view hierarchy.

> Note: This has no effect on non-widget system buttons in macOS.

---

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)