selection/DSRatingStars
DSRatingStars
selection5-star rating component with tap-to-rate, half-star display, and read-only mode.
iOS 17+macOS 14+
Purpose
Product reviews, app ratings, satisfaction surveys.
Interactive Reference
Live showroom
Need the full visual surface?
Screenshots do not scale well across every component, state, and variant. For the real interactive reference, import the package and launch DSShowcaseRoot().
Best for exploring:
variants, states, categories, and real app examples in one place.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| ratingreq | Binding<Double> | — | Current rating value (0.0–5.0). |
| maxStars | Int | 5 | Total number of stars. |
| size | DSButtonSize | .md | Star size. |
| isReadOnly | Bool | false | Disables tap interaction. |
| color | Color | DSColor.warning | Filled star colour. |
Examples
Review form
Tappable rating in a review submission form.
swift
DSRatingStars(rating: $reviewRating)
DSTextArea(placeholder: "Write your review...", text: $reviewText)
DSButton("Submit review", variant: .primary, action: submitReview)