selection/DSRatingStars

DSRatingStars

selection
since v2.0

5-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

PropTypeDefaultDescription
ratingreqBinding<Double>Current rating value (0.0–5.0).
maxStarsInt5Total number of stars.
sizeDSButtonSize.mdStar size.
isReadOnlyBoolfalseDisables tap interaction.
colorColorDSColor.warningFilled 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)

Related Components