View Source
PetalComponents.Rating
(petal_components v1.9.2)
Summary
Attributes
rating
(:any
) - The rating to display (integer or float). Defaults to 0
.round_to_nearest_half
(:boolean
) - Whether to round the rating to the nearest half star (eg. 3.3 -> 3.5. Defaults to true
.total
(:integer
) - The total number of stars to display. Defaults to 5
.class
(:string
) - Any additional CSS classes for the rating wrapper. Defaults to nil
.star_class
(:string
) - Any additional CSS classes for the individual stars. Eg. you could change the size of the stars with 'h-10 w-10'. Defaults to nil
.include_label
(:boolean
) - Whether to include an automatically generated rating label. Defaults to false
.label_class
(:string
) - Any additional CSS classes for the rating label. Defaults to nil
.
Attributes
class
(:string
) - Any additional CSS classes for the star. Defaults to nil
.type
(:atom
) - The type of star to display. Defaults to :empty
.
Functions
Attributes
rating
(:any
) - The rating to display (integer or float). Defaults to 0
.round_to_nearest_half
(:boolean
) - Whether to round the rating to the nearest half star (eg. 3.3 -> 3.5. Defaults to true
.total
(:integer
) - The total number of stars to display. Defaults to 5
.class
(:string
) - Any additional CSS classes for the rating wrapper. Defaults to nil
.star_class
(:string
) - Any additional CSS classes for the individual stars. Eg. you could change the size of the stars with 'h-10 w-10'. Defaults to nil
.include_label
(:boolean
) - Whether to include an automatically generated rating label. Defaults to false
.label_class
(:string
) - Any additional CSS classes for the rating label. Defaults to nil
.
Attributes
class
(:string
) - Any additional CSS classes for the star. Defaults to nil
.type
(:atom
) - The type of star to display. Defaults to :empty
.