A simple component used to view star ratings in SwiftUI. \n
Sizing can be controlled via .font()
and other SwiftUI related synatx.
iOS 14+
Installation can be handled via Xcode.
File
> Add package dependencies
using the Package URL: https://github.com/ben-wheeler/SimpleSwiftUIStarRating
See Xcode documentation for more details.
Component can easily be created with only a rating:
. But can also take in additional color
and maxRating
.
For Example:
SimpleSwiftUIStarRating(rating: 1.5)
SimpleSwiftUIStarRating(rating: 4.0, maxRating: 10)
SimpleSwiftUIStarRating(rating: 3.5, starColor: .red)
Sizing can be controlled via font()
.

SimpleSwiftUIStarRating(rating: 3.5, maxRating: 5, starColor: .red)
SimpleSwiftUIStarRating(rating: 4.0, maxRating: 10, starColor: .blue)
SimpleSwiftUIStarRating(rating: 1.5, maxRating: nil, starColor: nil)
.font(.title)