Skip to content

Rating ​

Hover koʻrinishi, yarim yulduz, emojilar, rang xaritalari, animatsiyalar va maxsus ikonkalar bilan yulduzli baholash.

3
vue
<template>
  <VxRating v-model="rating" />
</template>

Half Stars ​

3.5
vue
<template>
  <VxRating v-model="rating" allow-half />
</template>

Show Value, Count & Reviews ​

3/ 5(142)
vue
<template>
  <VxRating v-model="rating" show-value show-count :review-count="142" />
</template>

Format Value ​

3.5 pts
vue
<template>
  <VxRating v-model="rating" show-value :format-value="v => v.toFixed(1) + ' pts'" />
</template>

With Texts ​

Bad
vue
<template>
  <VxRating :texts="['Terrible', 'Bad', 'OK', 'Good', 'Excellent']" />
</template>

Heart Icon ​

vue
<template>
  <VxRating icon="heart" color="#ef4444" />
</template>

Thumb Icon ​

vue
<template>
  <VxRating icon="thumb" color="#3b82f6" :max="3" />
</template>

Emoji Mode ​

😡
😕
😐
🙂
😍
💀
👎
👌
👍
🔥
vue
<template>
  <VxRating :emojis="['😡', '😕', '😐', '🙂', '😍']" />
  <VxRating :emojis="['💀', '👎', '👌', '👍', '🔥']" />
</template>

Color Map ​

Har bir yulduz darajasi uchun boshqa rang.

3
vue
<template>
  <VxRating :color-map="['#ef4444', '#f97316', '#eab308', '#22c55e', '#10b981']" />
  <!-- 1 star = red, 2 = orange, 3 = yellow, 4 = green, 5 = emerald -->
</template>

Tooltip ​

Hover qilinganda "3 / 5" ni koʻrsatadi.

vue
<template>
  <VxRating v-model="rating" tooltip />
</template>

Animation ​

bounce
pulse
vue
<template>
  <VxRating animation="bounce" />
  <VxRating animation="pulse" />
</template>

Custom Icon (Slot) ​

vue
<template>
  <VxRating v-model="rating">
    <template #icon="{ state, color }">
      <MyIcon :active="state !== 'empty'" :color="color" />
    </template>
  </VxRating>
</template>

Custom Colors ​

vue
<template>
  <VxRating color="#22c55e" />
  <VxRating color="#f97316" inactive-color="#374151" />
</template>

Allow Clear ​

0
vue
<template>
  <VxRating v-model="rating" allow-clear />
</template>

Max Stars ​

3/ 3
2/ 10
vue
<template>
  <VxRating :max="3" />
  <VxRating :max="10" />
</template>

Sizes ​

xs
sm
default
lg
xl
vue
<template>
  <VxRating size="xs" />
  <VxRating size="sm" />
  <VxRating />
  <VxRating size="lg" />
  <VxRating size="xl" />
</template>

Readonly & Disabled ​

readonly
4.5
disabled
vue
<template>
  <VxRating :model-value="4.5" allow-half readonly show-value />
  <VxRating :model-value="3" disabled />
</template>

Props ​

PropTypeDefaultDescription
modelValuenumber0Baholash qiymati (v-model)
maxnumber5Maksimal yulduzlar
allowHalfbooleanfalseYarim yulduz tanlash
allowClearbooleanfalseQayta belgilash uchun aynisini bosish
disabledbooleanfalseOʻchirish
readonlybooleanfalseFaqat oʻqish
size'xs' | 'sm' | 'default' | 'lg' | 'xl''default'Oʻlcham
colorstring'#facc15'Faol rang
inactiveColorstring''Boʻsh ikonka rangi
colorMapstring[]—Har daraja boʻyicha rang (1=qizil, 2=toʻq sariq...)
icon'star' | 'heart' | 'thumb''star'Oʻrnatilgan ikonka
customIconComponent—Ikonka sifatida Vue komponenti
emojisstring[]—Har yulduz uchun emoji (ikonkalar oʻrnini bosadi)
showValuebooleanfalseRaqamli qiymatni koʻrsatish
showCountbooleanfalse"/ max" ni koʻrsatish
reviewCountnumber | string—"(142)" sharh sonini koʻrsatish
textsstring[]—Har daraja uchun label
tooltipbooleanfalseHover qilinganda "3 / 5" tooltip koʻrsatish
animation'' | 'bounce' | 'pulse'''Bosish animatsiyasi
formatValue(v: number) => string—Maxsus qiymat formatlovchisi

Events ​

EventTypeDescription
update:modelValue(v: number)Baholash oʻzgardi
change(v: number)Baholash oʻzgardi

Slots ​

SlotPropsDescription
icon{ index, state, color, inactiveColor }Maxsus ikonka. state: 'full' / 'half' / 'empty'