Skip to content

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 ​

PropertyAttributeTypeDefaultDescription
valuevaluenumber0Current rating value.
maxmaxnumber5Maximum number of stars.
readonlyreadonlybooleanfalseWhether the rating is read-only.
disableddisabledbooleanfalseWhether the rating is disabled.
clearableclearablebooleanfalseWhether clicking the current value clears the rating.
defaultValuedefaultValuenumber0Initial rating value for uncontrolled mode.
sizesizeSize'md'Size of the rating stars.
namenamestring''Form field name for the hidden input.
labellabelstring'Rating'Accessible label for the rating group.
precisionprecision1 | 0.51Rating step precision (1 for full stars, 0.5 for half stars).
requiredrequiredbooleanfalseMarks the rating as required for form validation.

Events ​

EventDetailDescription
flint-rating-change&#123; value: number &#125;Fired when the rating value changes. detail: &#123; value: number &#125;

CSS Parts ​

NameDescription
baseThe component's base wrapper element.

CSS Custom Properties ​

PropertyDefault
--flint-rating-size—
--flint-rating-color—
--flint-rating-empty-color—
--flint-font-family—
--flint-border-radius-sm—