Commonly Used Shapes and Utilities In SwiftUI

What's New

Added the OmniRectangle


SwiftUI Swift 5.1 Swift 5.1 kieranb662 followers

Commonly used shapes for SwiftUI, some I found on the web swiftui-lab and, others I made myself. I hope to create community based repo for cool animated shapes, paths, etc. If you would like to submit some of your own shapes just make a pull request and I will try to approve it ASAP. If you want to try out this package just clone the example project

Or create your own shapes using the bez editor app available for free on iOS 13.4 and greater.

  • AnyShape: A type erased Shape

  • Lines

    • Line
    • HorizontalLine
    • VerticalLine
    • AdaptiveLine
  • Triangles

    • Triangle
    • OpenTriangle
    • RightTriangle
  • Graphing

    • CartesianGrid
    • TickMarks
    • PolarGrid
    • RadialTickMarks
  • Misc

    • InfinitySymbol
    • Arrow
    • Polygon
    • Pentagon
    • PathText
    • FoldableShape



Found at drawing trees. A Line defined by the from and to points.


A horizontal line that is the width of its container has a single parameter offset: A value between 0 and 1 defining the lines vertical offset in its container (Default: 0.5)


A Vertical line that is the height of its container has a single parameter offset: A value between 0 and 1 defining the line's horizontal offset in its container (Default: 0.5)


This shape creates a line centered inside of and constrained by its bounding box. The end points of the line are the points of intersection of an infinitely long angled line and the container rectangle


The various triangles are shown below.


Cartesian Grid

A Rectangular grid of vertical and horizontal lines. Has two parameters xCount: The number of vertical lines yCount: The number of horizontal lines

Polar Grid

A grid made up of concentric circles and angled lines running through their center. rCount: The number of Circles thetaCount: The number of lines


Tick marks spaced out evenly with varying lengths dependent on the type of tick minor, semi, or major.

The shape has two parameters spacing: CGFloat and ticks: Int. The spacing is the distance between ticks while the ticks is the number of tick marks.

An examples using TickMarks are shown below



An arrow that starts out small shaped like this |--| but as it grows larger it looks like this <---->


Foldable Shapes


If you have an idea for a shape but don't know how to describe it, try out the PathEditor tool that comes packaged with bez


  • Swift Tools 5.3.0
View More Packages from this Author


Last updated: Sat Nov 19 2022 04:36:23 GMT-0500 (GMT-05:00)