Description
@rc-component/rate is an accessible React rating component, such as a row of stars that a user can click to give a score. It is part of the Ant Design ecosystem and is maintained by the rc-component team. It supports both controlled and uncontrolled rating values, half-star selection, custom characters and custom rendering of each item, and keyboard interaction. It also offers focus and blur methods through a ref, a disabled state, and right-to-left display. The component accepts a count for the number of items, defaults to five, and uses a star character by default, which can be replaced. A click on the selected item again can clear the value, unless allowClear is turned off. The README documents each prop in a table, covering value, defaultValue, allowHalf, onChange, onHoverChange, the keyboard setting and the class prefix. TypeScript definitions are included for the props and the imperative ref. The package has a local dumi site with examples and is released under the MIT licence. It suits React developers who need a rating input, such as product or review stars, that works with the keyboard.…
Highlights
- Controlled and uncontrolled ratings
- Half-star selection and custom characters
- Keyboard support and right-to-left layout
- TypeScript types and focus methods
Ratings & Reviews
No ratings yet
Be the first to rate rc-rate.
People also visit
rc-rate FAQ
What does the rate component do?
It is a React rating input, such as a row of stars, that users can click or use with the keyboard.
Can it show half stars?
Yes. Set allowHalf to enable half-item selection.
Can I change the icon?
Yes. The character prop takes your own character or a function, and characterRender can customise each item.
Does it support right-to-left text?
Yes. Set direction to rtl for right-to-left display.
What license is it under?
MIT, according to the repository.
What are the best rc-rate alternatives?
Popular alternatives to rc-rate include react-rater, react-rating and react-input-range. See all rc-rate alternatives



















