---
title: "init(roundedRect:cornerSize:style:)"
framework: swiftui
role: symbol
role_heading: Initializer
path: "swiftui/path/init(roundedrect:cornersize:style:)"
---

# init(roundedRect:cornerSize:style:)

Creates a path containing a rounded rectangle.

## Declaration

```swift
init(roundedRect rect: CGRect, cornerSize: CGSize, style: RoundedCornerStyle = .continuous)
```

## Parameters

- `rect`: A rectangle, specified in user space coordinates.
- `cornerSize`: The size of the corners, specified in user space coordinates.
- `style`: The corner style. Defaults to the continous style if not specified.

## Discussion

Discussion This is a convenience function that creates a path of a rounded rectangle. Using this convenience function is more efficient than creating a path and adding a rounded rectangle to it.

## See Also

### Creating a path

- [init()](swiftui/path/init().md)
- [init(_:)](swiftui/path/init(_:).md)
- [init(ellipseIn:)](swiftui/path/init(ellipsein:).md)
- [init(roundedRect:cornerRadius:style:)](swiftui/path/init(roundedrect:cornerradius:style:).md)
- [init(roundedRect:cornerRadii:style:)](swiftui/path/init(roundedrect:cornerradii:style:).md)
