Components
Display a star rating out of 5.0.
| Version: | 14.18.2 •View source•Changelog•Report issue | |
|---|---|---|
| Install: | yarn add @thumbtack/thumbprint-react | |
| Import: | import { StarRating } from '@thumbtack/thumbprint-react'; | |
StarRating with inline textThe hoverRating, onStarClick, onStarHover, and onMouseLeave props make it possible to build an interactive StarRating component.
ratingNumber from 0-5 at increments of 0.5. Numbers between these steps will be rounded.
numberhoverRatingNumber from 0-5 at increments of 1. hoverRating trumps rating with respect to star
highlighting.
This prop can be one of the following 6 types:
0123450sizeThe size of the component when rendered
This prop can be one of the following 3 types:
'small''medium''large''small'onStarClickFunction that is called when a user clicks on a star. The function is supplied a single parameter?: the value of the clicked star.
(value: number) => voidnooponStarHoverFunction that is called when a user hovers over a star. The function is supplied a single parameter?: the value of the hovered star.
(value: number) => voidnooponMouseLeaveFunction that is called when a user mouses away from the StarRating component
() => voidnoop