Swiftpack.co - spacenation/swiftui-shapes as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
:rocket: Collection of SwiftUI shapes
.package(url: "https://github.com/spacenation/swiftui-shapes.git", from: "1.1.0")

SwiftUI Shapes

Collection of custom shapes

Regular Polygons

RegularPolygon(sides: 32)
RoundedRegularPolygon(sides: 6, radius: 20)

Lines and Curves

QuadCurve(unitPoints: [
    UnitPoint(x: 0.1, y: 0.1),
    UnitPoint(x: 0.5, y: 0.9),
    UnitPoint(x: 0.9, y: 0.1)
.stroke(Color.blue, style: .init(lineWidth: 2, lineCap: .round))
.frame(height: 200)


GridPattern(horizontalLines: 20, verticalLines: 40)
    .stroke(Color.white.opacity(0.3), style: .init(lineWidth: 1, lineCap: .round))
    .frame(height: 200)


Add Shapes to your project with Swift Package Manager

// swift-tools-version:5.3
import PackageDescription

let package = Package(
    name: "YOUR_PROJECT",
    dependencies: [
        .package(url: "https://github.com/spacenation/swiftui-shapes.git", from: "1.1.0"),

Code Contributions

Feel free to contribute via fork/pull request to master branch. If you want to request a feature or report a bug please start a new issue.


Stars: 171
Last commit: 2 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

Related Packages

Release Notes

Version 1.1.0
44 weeks ago
  • RoundedRegularPolygons (thanks to @ToddGeorgeKelly)
  • Replacing predefined polygons with new API
RegularPolygon(sides: 32)
RoundedRegularPolygon(sides: 6, radius: 20)
  • Sides parameter is now UInt
  • Xcode Previews

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics