Rate
Documentation and examples for the Rate component.
사용 시기
- 평가를 표시합니다.
- 무언가에 대한 빠른 평가 작업.
Example Usage
astro
---
import Rate from '@/components/data-entry/Rate.astro';
---
<Rate value={4} max={5} /> Half-Stars
Enable half-star precision with the allowHalf prop.
astro
<Rate value={3.5} max={5} allowHalf={true} /> Colors and Icons
Customize the appearance with color and icon props.
astro
<Rate value={4} max={5} color="yellow" />
<Rate value={3} max={5} color="red" icon="Heart" />
<Rate value={5} max={5} color="green" icon="ThumbsUp" /> Sizes
astro
<Rate value={3} max={5} size="sm" />
<Rate value={3} max={5} size="md" />
<Rate value={3} max={5} size="lg" /> API
| 속성 | 설명 | 타입 | 기본값 |
|---|---|---|---|
| value | 평가의 현재 값 | number | 0 |
| max | 최대 평가 값 | number | 5 |
| readonly | 참인 경우 평가를 수정할 수 없습니다 | boolean | false |
| name | 숨겨진 입력의 이름 속성 | string | 'rating' |
| icon | 평가에 사용할 아이콘 | IconName | 'Star' |
| color | 평가 별의 색상 변형 | 'default' | 'yellow' | 'orange' | 'red' | 'green' | 'blue' | 'purple' | 'default' |
| allowHalf | 반 별 평가 허용 여부 | boolean | false |
| size | 평가 아이콘의 크기 | 'sm' | 'md' | 'lg' | 'md' |
| error | Indicates an error state or displays an error message | string | boolean | |
| success | Indicates a success state or displays a success message | string | boolean | |
| disabled | Disables the component | boolean | false |