Rate
Data Entry
@rockshin/tao-uiLets people choose a rating with full or half steps.
When to use
Use for a short ordered scale. Add a visible label and explain what the highest and lowest ratings mean.
Examples
Controlled half-star rating
Arrow keys move the rating. allowHalf enables half steps and tooltips explain each whole-star score.
Allow or prevent clearing
With allowClear enabled, clicking the selected score again resets it to zero.
Click the selected star to clear
A value is always retained
Read-only and disabled
readOnly presents an existing score; disabled communicates that the control is unavailable.
Average: 4.5
Rating unavailable
Custom characters and count
character can be a node or a function of the item index.
- ♥♥
- ♥♥
- ♥♥
- 11
- 22
- 33
- 44
- 55
Sizes and provider defaults
small, middle and large are accepted. The native medium spelling is also supported.
Focus and semantic customization
Use the ref when another action needs to move focus into the rating control.