# Rating

Source: https://lumeo.nativ.sh/components/rating

# Rating

A star rating input for collecting feedback.

## Installation

.NET CLI PackageReference Lumeo CLI

dotnet add package Lumeo

One-time app setup (`AddLumeo()`, CSS & JS) is covered in the [installation guide](docs/introduction).

## Usage

@using Lumeo

<Rating />

## When to Use

-   Product or service reviews where users submit star ratings
-   Feedback forms for satisfaction or experience scoring
-   Displaying average ratings in read-only mode on product cards
-   Any scenario requiring a quick visual numeric rating (e.g., difficulty, quality)

Preview Code

Basic Rating

Preview Code

Half Stars

Value: 3.5

Preview Code

Sizes

Preview Code

Read-Only

Preview Code

Custom Max

Preview Code

Size — interactive preview

Pick a size to see the star scale live.

Small Default Large

Size: Default — Value: 3

**Mobile (rc.49).** The star rating now uses pointer events so users can drag a finger across the stars to set a value in one smooth gesture — no need to lift and tap each star individually.

## API Reference

### Rating

Property

Type

Default

Description

Value

double

0

Current rating value.

Max

int

5

Maximum number of stars.

AllowHalf

bool

false

Enable half-star precision.

ReadOnly

bool

false

Disable user interaction.

Size

RatingSize

Default

Star size. Values: Small, Default, Large.

Icon

RenderFragment?

null

Custom icon replacing default stars.

ValueChanged

EventCallback<double>

—

Two-way binding callback; fires when the rating changes.

IconContent

RenderFragment?

null

Custom icon slot used for each rating unit.

ErrorText

string?

null

Error message displayed below the rating when Invalid is true.

HelperText

string?

null

Helper text shown below the rating when not invalid.

Invalid

bool

false

Applies error styling. Syncs with a parent FormField.

Label

string?

null

Label rendered above the rating (standalone, without FormField).

Name

string?

null

HTML name attribute for form submission.

Required

bool

false

Marks the field as required. Syncs with a parent FormField.

## Related Components

-   [Slider](/components/slider) — Continuous range input when discrete star levels are insufficient
-   [Progress](/components/progress) — Display a score or completion percentage as a bar
-   [Input](/components/input) — Free-form numeric input for precise rating values
