Swiftpack.co - franklynw/StarRatingView as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by franklynw.
franklynw/StarRatingView 2.0.2
A SwiftUI Rating view
⭐️ 0
🕓 3 weeks ago
.package(url: "https://github.com/franklynw/StarRatingView.git", from: "2.0.2")


A simple SwiftUI rating view, with customisable colours.

Example 1


Swift Package Manager

In Xcode:


NB: All examples require import StarRatingView at the top of the source file

StarRatingView(rating: rating)

Set a precise width

You can specify a width for the stars view in the init -

StarRatingView(rating: rating, width: geometry.size.width * 0.5)

If the width parameter is omitted, it will fit into the available space.

Set the base colour

StarRatingView(rating: rating)

Set the hightlighted colour

StarRatingView(rating: rating)

Draw an outline around the stars (the highlighted portions)

StarRatingView(rating: rating)
    .outline(.purple, weight: .semibold)


StarRatingView is available under the MIT licence.


Stars: 0
Last commit: 3 weeks ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

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