Rating ​
Interactive
Loading...
Values
Loading...
Disabled
Loading...
Rating: a star-based rating input.
- Tag:
<flint-rating> - Class:
FlintRating
Import ​
ts
import '@getufy/flint-ui'; // auto-registers all
// or
import { FlintRating } from '@getufy/flint-ui';Usage ​
html
<flint-rating></flint-rating>Properties ​
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
value | value | number | 0 | Current rating value. |
max | max | number | 5 | Maximum number of stars. |
readonly | readonly | boolean | false | Whether the rating is read-only. |
disabled | disabled | boolean | false | Whether the rating is disabled. |
clearable | clearable | boolean | false | Whether clicking the current value clears the rating. |
defaultValue | defaultValue | number | 0 | Initial rating value for uncontrolled mode. |
size | size | Size | 'md' | Size of the rating stars. |
name | name | string | '' | Form field name for the hidden input. |
label | label | string | 'Rating' | Accessible label for the rating group. |
precision | precision | 1 | 0.5 | 1 | Rating step precision (1 for full stars, 0.5 for half stars). |
required | required | boolean | false | Marks the rating as required for form validation. |
Events ​
| Event | Detail | Description |
|---|---|---|
flint-rating-change | { value: number } | Fired when the rating value changes. detail: { value: number } |
CSS Parts ​
| Name | Description |
|---|---|
base | The component's base wrapper element. |
CSS Custom Properties ​
| Property | Default |
|---|---|
--flint-rating-size | — |
--flint-rating-color | — |
--flint-rating-empty-color | — |
--flint-font-family | — |
--flint-border-radius-sm | — |