Feedback/DSStarRating

DSStarRating

feedback
since 1.2.0

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

PropTypeDefaultDescription
valuereqDoubleโ€”Rating value from 0.0 to 5.0
sizeCGFloat16Star icon size in points
activeColorColorDSColor.warningFilled star color
inactiveColorColor?DSColor.subtleEmpty star color
accessibilityLabelString?nilOptional 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

Related Components