Feedback/DSStarRatingControl
DSStarRatingControl
feedbackInteractive star rating control allowing users to input ratings from 0 to 5.
iOSmacOS
Purpose
Use for collecting user ratings, reviews, or feedback. Tappable stars with half-star support.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| valuereq | Binding<Double> | โ | Binding to rating value (0.0-5.0) |
| size | CGFloat | 24 | Star size in points |
| activeColor | Color | DSColor.warning | Filled star color |
| accessibilityLabel | String? | nil | Optional accessibility label |
Examples
Review form
Interactive rating input for reviews.
swift
@State var rating: Double = 0
VStack(alignment: .leading) {
Text("Rate this product")
.font(.system(size: 15, weight: .medium))
DSStarRatingControl(value: $rating, size: 28)
}Usage Guidelines
- Use for collecting user ratings
- Larger tap targets (24pt+) for better usability
- Provide clear label explaining what is being rated
- Consider showing current value numerically alongside stars