# El Rate

> Rate component for rating functionality.

Rate component for rating functionality. Invoke when user needs to collect user ratings, display star ratings, or allow feedback scoring.

- Page: https://ss33.ai/skills/jiaiyan/el-rate-13231390552
- Publisher: jiaiyan
- Category: [Software Development](https://ss33.ai/skills/category/software-development-t44z8z) › [Frontend & UI](https://ss33.ai/skills/category/software-development-t44z8z/frontend-and-ui-q25e9r)
- License: MIT
- Source: https://github.com/jiaiyan/element-plus-skills/blob/1d126b39a80523665cc6290f70ce25aa89d708ae/components/el-rate/SKILL.md

## Skill

SKILL.md: https://ss33.ai/api/v1/ss33/download/jiaiyan/el-rate-13231390552

# Rate Component

Rate component is used for rating with customizable icons and levels.

## When to Use

- User ratings
- Product reviews
- Feedback scoring
- Star ratings

## Basic Usage

```vue
<template>
  <el-rate v-model="value" />
</template>

<script setup>
import { ref } from 'vue'

const value = ref(0)
</script>
```

## With Half Stars

```vue
<template>
  <el-rate v-model="value" allow-half />
</template>
```

## With Text

```vue
<template>
  <el-rate
    v-model="value"
    show-text
    :texts="['Bad', 'Poor', 'Fair', 'Good', 'Excellent']"
  />
</template>
```

## Clearable

```vue
<template>
  <el-rate v-model="value" clearable />
</template>
```

## Custom Icons

```vue
<template>
  <el-rate
    v-model="value"
    :icons="[StarFilled, StarFilled, StarFilled]"
    :void-icon="Star"
  />
</template>

<script setup>
import { StarFilled, Star } from '@element-plus/icons-vue'
</script>
```

## Read-only

```vue
<template>
  <el-rate
    v-model="value"
    disabled
    show-score
    score-template="{value} points"
  />
</template>
```

## API Reference

### Attributes

| Name | Description | Type | Default |
|------|-------------|------|---------|
| model-value / v-model | Binding value | `number` | `0` |
| max | Max rating score | `number` | `5` |
| size | Size | `'large' \| 'default' \| 'small'` | — |
| disabled | Read-only | `boolean` | `false` |
| allow-half | Allow half stars | `boolean` | `false` |
| low-threshold | Low/medium threshold | `number` | `2` |
| high-threshold | Medium/high threshold | `number` | `4` |
| colors | Colors for levels | `string[] \| Record<number, string>` | — |
| void-color | Color of unselected | `string` | `'#c6d1de'` |
| icons | Icon components | `string[] \| Component[]` | — |
| void-icon | Unselected icon | `string \| Component` | — |
| show-text | Display texts | `boolean` | `false` |
| show-score | Display score | `boolean` | `false` |
| text-color | Text color | `string` | `''` |
| texts | Text array | `string[]` | — |
| score-template | Score template | `string` | `'{value}'` |
| clearable | Can reset to 0 | `boolean` | `false` |

### Events

| Name | Description | Type |
|------|-------------|------|
| change | Triggers when value changes | `(value: number) => void` |

## Best Practices

1. Use `allow-half` for precise ratings
2. Use `show-score` for read-only displays
3. Use `clearable` to allow resetting
