An animatable SwiftUI rectangle shape with fine-grained corner rounding configuration.

SwiftUI Precisely Rounded Rectangle

Twitter: @cypher_poet

An animatable SwiftUI rectangle shape with support for individual corner rounding measurements.


Xcode Projects

Select File -> Swift Packages -> Add Package Dependency and enter https://github.com/CypherPoet/PreciselyRoundedRectangle.

Swift Package Manager Projects

You can add SwiftUIPreciselyRoundedRectangle as a package dependency in your Package.swift file:

let package = Package(
    dependencies: [
            name: "SwiftUIPreciselyRoundedRectangle",
            url: "https://github.com/CypherPoet/PreciselyRoundedRectangle",
            .upToNextMinor(from: "0.1.0")

From there, refer to the PreciselyRoundedRectangle "product" delivered by the SwiftUIPreciselyRoundedRectangle "package" inside of any of your project's target dependencies:

targets: [
        name: "YourLibrary",
        dependencies: [
                name: "PreciselyRoundedRectangle",
                package: "SwiftUIPreciselyRoundedRectangle"

Then simply import PreciselyRoundedRectangle wherever you’d like to use it.


Contributions to PreciselyRoundedRectangle are most welcome. Check out some of the issue templates for more info.

💻 Developing


  • Xcode 13.0+ (Recommended)

📜 Creating & Building Documentation

Documentation is built with Xcode's DocC. See Apple's guidance on how to build, run, and create DocC content.

For now, the best way to view the docs is to open the project in Xcode and run the Build Documentation command. At some point in the future, I'm hoping to leverage the tooling the develops for generating/hosting DocC documentation. (Please feel free to let me know if you have any ideas or tooling recommendations around this 🙂).

🏷 License

PreciselyRoundedRectangle is available under the MIT license. See the LICENSE file for more info.


  • Swift Tools 5.5.0
View More Packages from this Author


Last updated: Wed Nov 29 2023 14:35:06 GMT-1000 (Hawaii-Aleutian Standard Time)