Feedback/DSStarRating
DSStarRating
feedbackDisplay-only star rating showing a value from 0 to 5 stars.
iOSmacOS
Purpose
Use to display ratings, reviews, or quality scores. Supports half-stars for precise values.
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 |
|---|---|---|---|
| valuereq | Double | โ | Rating value from 0.0 to 5.0 |
| size | CGFloat | 16 | Star icon size in points |
| activeColor | Color | DSColor.warning | Filled star color |
| inactiveColor | Color? | DSColor.subtle | Empty star color |
| accessibilityLabel | String? | nil | Optional accessibility label |
Examples
Product rating
Display product rating with stars.
swift
DSStarRating(
product.rating,
size: 18,
activeColor: DSColor.warning
)Review score
Show review score with half-stars.
swift
HStack {
DSStarRating(4.5, size: 16)
Text("(127 reviews)")
.font(.system(size: 13))
.foregroundStyle(DSColor.muted)
}Usage Guidelines
- Use for read-only rating display
- Supports half-star increments for precision
- Pair with review count for context
- Use DSStarRatingControl for interactive rating input