mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-09 02:49:18 +08:00
* docs: remove autoFocus property from various components doc to common-props doc * chore: update docs * chore: update docs
2.5 KiB
2.5 KiB
category, group, title, description, cover, coverDark, demo
| category | group | title | description | cover | coverDark | demo | ||
|---|---|---|---|---|---|---|---|---|
| Components | Data Entry | Rate | Used for rating operation on something. | https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*oyOcTrB12_YAAAAAAAAAAAAADrJ8AQ/original | https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*M7_ER7GJr6wAAAAAAAAAAAAADrJ8AQ/original |
|
When To Use
- Show evaluation.
- A quick rating operation on something.
Examples
Basic
Sizes
Half star
Show copywriting
Read only
Clear star
Other Character
Customize character
Component Token
API
Common props ref:Common props
| Property | Description | type | Default | Version |
|---|---|---|---|---|
| allowClear | Whether to allow clear when click again | boolean | true | |
| allowHalf | Whether to allow semi selection | boolean | false | |
| character | The custom character of rate | ReactNode | (RateProps) => ReactNode | <StarFilled /> | function(): 4.4.0 |
| className | The custom class name of rate | string | - | |
| count | Star count | number | 5 | |
| defaultValue | The default value | number | 0 | |
| disabled | If read only, unable to interact | boolean | false | |
| keyboard | Support keyboard operation | boolean | true | 5.18.0 |
| size | Star size | 'small' | 'middle' | 'large' | 'middle' | |
| style | The custom style object of rate | CSSProperties | - | |
| tooltips | Customize tooltip by each character | TooltipProps[] | string[] | - | |
| value | The current value | number | - | |
| onBlur | Callback when component lose focus | function() | - | |
| onChange | Callback when select value | function(value: number) | - | |
| onFocus | Callback when component get focus | function() | - | |
| onHoverChange | Callback when hover item | function(value: number) | - | |
| onKeyDown | Callback when keydown on component | function(event) | - |
Methods
| Name | Description |
|---|---|
| blur() | Remove focus |
| focus() | Get focus |