Star Rating
premiumStar rating component with configurable max stars.
Overview
The Star Rating component lets users rate something by clicking on stars. Treats 0 as "no selection" for required validation. Includes a hidden input for native form submission.
Properties
| Property | Type | Default | Description |
|---|---|---|---|
name | String | "rating" | Field name used in form data. |
label | String | "Rating" | Label displayed above the stars. |
required | Boolean | false | Whether a rating must be selected (0 = no selection). |
Features
- Click or hover to select rating
- Configurable max stars
- Custom filled/empty star colors
- 0 treated as "no selection" for required validation
- Hidden <input> for native form submission
Tips
A value of 0 is treated as "no selection" — this means required validation works correctly.
Use custom star colors to match your brand.
Validation
This component uses rating validation. See the Validation Guide for details on configuring rules and error messages.