JGuang

Rate

Rate · Arco Design

Preview
npm install @arco-design/web-react@2.66.18

Rate

Rate is used for scoring.

Install

npm install @arco-design/web-react@2.66.18

Import @arco-design/web-react/dist/css/arco.css at the entry and set the locale with ConfigProvider. React 19 projects must also import @arco-design/web-react/es/_util/react-19-adapter first, or imperative APIs such as Message and Modal cannot render.

Examples

  • Basic: Basic usage of Rate.
  • Allow Half: Specify allowHalf to support half selection.
  • With Text: Use Rate with text description.
  • Read Only: Specify Rate as read-only via readonly.
  • Allow Clear: Specify allowClear to allow clearing of ratings. 指定 allowClear 来允许清除评分。
  • Custom Character: Use character to customize the characters used in Rate.
  • Customize Count: Create a score component of any total count by specifying count.
  • Smiley Icon: Use grading to show score with smiley icons.
  • Tooltips: Use tooltips to provide hint information for each rating when the mouse is hovering.

Examples come from the official Arco Design repository (MIT) at the commit published as npm 2.66.18. Some use online images or upload endpoints; network requests are disabled in previews.

API

Rate

PropertyDescriptionTypeDefaultValue
allowClearWhether to allow clear when click againboolean-
allowHalfWhether to allow half selectionboolean-
disabledWhether is disabledboolean-
gradingWhether to show score with smiley iconboolean-
readonlyWhether is readonlyboolean-
countStar countnumber5
defaultValueTo set default valuenumber-
valueTo set valuenumber-
classNameAdditional css classstring | string[]-
styleAdditional styleCSSProperties-
tooltipsCustomize tooltip by each characterstring[]-
characterThe custom character of rateReactNode | ((index: number) => ReactNode)<IconStarFill />
onChangeCallback when score is changed(value: number) => void-
onHoverChangeCallback when the score user hovered is changed(value: number) => void-