ant-design/components/rate/index.en-US.md

41 lines
1.3 KiB
Markdown
Raw Normal View History

---
category: Components
type: Data Entry
title: Rate
---
Rate component.
2016-09-10 13:43:30 +08:00
## When To Use
2016-11-16 21:33:37 +08:00
- Show evaluation.
- A quick rating operation on something.
## API
| Property | Description | type | Default |
| --- | --- | --- | --- |
| allowClear | whether to allow clear when click again | boolean | true |
| allowHalf | whether to allow semi selection | boolean | false |
| autoFocus | get focus when component mounted | boolean | false |
2020-04-28 16:46:50 +08:00
| character | custom character of rate | ReactNode | [<StarFilled /\>](https://ant.design/components/icon/) |
| className | custom class name of rate | string | |
| count | star count | number | 5 |
| defaultValue | default value | number | 0 |
| disabled | read only, unable to interact | boolean | false |
2020-04-28 14:09:54 +08:00
| style | custom style object of rate | CSSProperties | |
| tooltips | Customize tooltip by each character | string\[] | |
| value | 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 |