Rating
Interactive rating component for capturing user feedback and displaying scores.
Installation
Install the component
templui add ratingAdd the JavaScript to your layout
@rating.Script()Call this template in your base layout file (e.g., in the <head> section).
Examples
With Label
Styles
Precision (Read-Only)
Max Values
Form
API Reference
Rating
Main rating component container.
| Name | Type | Default |
|---|---|---|
Unique identifier for the rating component | | |
Additional CSS classes to apply to the rating container | | |
Additional HTML attributes to apply to the rating container | | |
Current rating value | | |
Whether the rating is read-only | | |
Precision for rating values (e.g., 0.5 for half-star ratings) | | |
Name attribute for the hidden input field | | |
Whether to only allow integer rating values | | |
Rating.Group
Container for grouping rating items.
| Name | Type | Default |
|---|---|---|
Unique identifier for the group element | | |
Additional CSS classes to apply to the group | | |
Additional HTML attributes to apply to the group | | |
Rating.Item
Individual rating item (star, heart, emoji).
| Name | Type | Default |
|---|---|---|
Unique identifier for the item element | | |
Additional CSS classes to apply to the item | | |
Additional HTML attributes to apply to the item | | |
Numeric value for this rating item | | |
Visual style for the rating item (star, heart, emoji) | | |