Rating
Emoji ratings are to be used to collect a user’s experience in the form of an emotional ranking. Like star ratings, there five options.
Star ratings are to be used to collect feedback from a user’s experience with a product. The stars indicate a performance rating from one to five.
Accessibility
This component uses the [role="radiogroup"]
attribute with the following attributes for each individual rating item:
[role="radio"]
[tabindex=0]
[aria-setsize=5]
- total number of elements within the Rating[aria-checked]
- if the rating is active[aria-posinset]
- position within the Rating
Overrides
Additionally, you can fully customize any part of the Rating through the overrides prop. The Rating consists of multiple subcomponents that are listed bellow and you can override each one of them. To help you identify the names of these subcomponents, you can highlight them through this selector:
Note: You should always use longhand CSS properties. Mixing shorthands and longhands will lead into strange behaviors!
Star Rating API
Warning
any
= "Prop types are not shown in dev mode"
extract-react-types is not being run in dev mode for speed reasons. If you need to
see prop types add the environment variable FORCE_EXTRACT_REACT_TYPES
eg:
FORCE_EXTRACT_REACT_TYPES=true yarn start <packageName>
FORCE_EXTRACT_REACT_TYPES=true yarn start:<team>
Emotion Rating API
Warning
any
= "Prop types are not shown in dev mode"
extract-react-types is not being run in dev mode for speed reasons. If you need to
see prop types add the environment variable FORCE_EXTRACT_REACT_TYPES
eg:
FORCE_EXTRACT_REACT_TYPES=true yarn start <packageName>
FORCE_EXTRACT_REACT_TYPES=true yarn start:<team>