Rating Bar

Backpack-SwiftUI/RatingBar

Cocoapods class reference view on Github

Day Night

Usage

Default


                                                
                                                BPKRatingBar(
                                                    label: "Rating",
                                                    value: 4.5,
                                                    accessibilityLabel: "Rating of 4.5"
                                                )

Customising the Scale

You can customise the scale of the rating bar by setting the ratingStyle property. The available styles are:

  • zeroToFive (default)
  • zeroToTen

Zero to Ten


                                                
                                                BPKRatingBar(
                                                    label: "Rating",
                                                    value: 8,
                                                    accessibilityLabel: "Rating of 8",
                                                    ratingScale: .zeroToTen
                                                )

Customising the Style

You can customise the style of the rating bar by setting the style property. The available styles are:

  • default (default)
  • onContrast

On Contrast


                                                
                                                BPKRatingBar(
                                                    label: "Rating",
                                                    value: 4.5,
                                                    accessibilityLabel: "Rating of 4.5 out of 5",
                                                    style: .onContrast
                                                )