Skip to content

Rating

Collect product scores and satisfaction signals with accessible radio semantics, or present a non-interactive RatingDisplay.

Default Rendered example
Product rating
Usage Example
@rating.Rating(rating.Config{
    ID: "rating-default",
    Name: "rating",
    Value: 3,
    Label: "Product rating",
})

Built-in text: the development API provides expressions.Rating for application defaults, request preferences, and individual component overrides. Read the expression guide.

Emoji Rating

Switch to sentiment icons for feedback flows that should feel more conversational.

Emoji Rating Rendered example
Satisfaction
Emoji Rating
@rating.Rating(rating.Config{
    ID: "rating-emoji",
    Name: "sentiment",
    Value: 4,
    Appearance: rating.AppearanceEmoji,
    Label: "Satisfaction",
})

Sizes

Use SizeSM, SizeMD, SizeLG, or SizeXL to fit dense forms or larger feedback moments.

Sizes Rendered example
Small
Medium
Large
XL
Sizes
@rating.Rating(rating.Config{
    ID: "rating-size-md",
    Name: "rating-size-md",
    Value: 3,
    Size: rating.SizeMD,
    Label: "Medium",
    ShowLabel: true,
})

Disabled

Disabled ratings keep their selected value visible while blocking interaction.

Disabled Rendered example
Locked rating
Disabled
@rating.Rating(rating.Config{
    ID: "rating-disabled",
    Name: "disabled-rating",
    Value: 2,
    Disabled: true,
})

Rating Display

RatingDisplay owns the same visual language as a non-interactive summary.

Rating Display Rendered example
Rating Display
@rating.RatingDisplay(rating.DisplayConfig{
    ID: "rating-display",
    Value: 4,
    Label: "Average rating",
    ShowLabel: true,
})

Go API

v0.4.0

The examples above cover behavior and composition. pkg.go.dev is the canonical reference for exported types, functions, methods, and Go documentation.

github.com/araihu/goshtoso/components/rating
Open v0.4.0 API