| 使用import { Rate } from "antd"; | 
| 文档 | 
文档贡献者
通用属性参考:通用属性
| 属性 | 说明 | 类型 | 默认值 | 版本 | 
|---|---|---|---|---|
| allowClear | 是否允许再次点击后清除 | boolean | true | |
| allowHalf | 是否允许半选 | boolean | false | |
| autoFocus | 自动获取焦点 | boolean | false | |
| character | 自定义字符 | ReactNode | (RateProps) => ReactNode | <StarFilled /> | function(): 4.4.0 | 
| className | 自定义样式类名 | string | - | |
| count | star 总数 | number | 5 | |
| defaultValue | 默认值 | number | 0 | |
| disabled | 只读,无法进行交互 | boolean | false | |
| keyboard | 支持使用键盘操作 | boolean | true | 5.18.0 | 
| style | 自定义样式对象 | CSSProperties | - | |
| tooltips | 自定义每项的提示信息 | string[] | - | |
| value | 当前数,受控值 | number | - | |
| onBlur | 失去焦点时的回调 | function() | - | |
| onChange | 选择时的回调 | function(value: number) | - | |
| onFocus | 获取焦点时的回调 | function() | - | |
| onHoverChange | 鼠标经过时数值变化的回调 | function(value: number) | - | |
| onKeyDown | 按键回调 | function(event) | - | 
| 名称 | 描述 | 
|---|---|
| blur() | 移除焦点 | 
| focus() | 获取焦点 | 
| Token 名称 | 描述 | 类型 | 默认值 | 
|---|---|---|---|
| starBg | 星星背景色 | string | rgba(0,0,0,0.06) | 
| starColor | 星星颜色 | string | #fadb14 | 
| starHoverScale | 星星悬浮时的缩放 | readonly string[] | Transform | readonly Transform[] | { _multi_value_?: boolean; _skip_check_?: boolean; value: readonly string[] | Transform | (readonly string[] | Transform | undefined)[] | undefined } | undefined | scale(1.1) | 
| starSize | 星星大小 | number | 20 |