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
🕓 23 weeks ago
iOS
.package(url: "https://github.com/franklynw/StarRatingView.git", from: "2.0.2")

StarRatingView

A simple SwiftUI rating view, with customisable colours.

Example 1

Installation

Swift Package Manager

In Xcode:

Example

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

StarRatingView(rating: rating)
    .outline(.purple)
    .padding()

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)
    .baseColor(.myLightBlueColor)

Set the hightlighted colour

StarRatingView(rating: rating)
    .highlightedColor(.myBrightPinkColor)

Draw an outline around the stars (the highlighted portions)

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

Licence

StarRatingView is available under the MIT licence.

GitHub

link
Stars: 0
Last commit: 1 week ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

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