Rate

Collect or display a rating with selectable symbols.

Rate

Default

Rate divides rating scores into several levels and these levels can be distinguished by using different background colors. By default background colors are the same, but you can assign them an array with three element to reflect three levels using the colors attribute, and their two thresholds can be defined by low-threshold and high-threshold, or you can assign them with a object which key is the threshold between two levels and value is the corresponding color.

Size

Rate has small,default and large sizes.

With allow-half

Add attribute allow-half Half star allowed

With text

Using text to indicate rating score

Add attribute show-text to display text at the right of Rate. You can assign texts for different scores using texts. texts is an array whose length should be equal to the max score max.

Clearable

You can reset the value to 0 when you click at the same value again.

More icons

You can use different icons to distinguish different rate components.

You can customize icons by passing icons an array with three elements or a object which key is the threshold between two levels and value is the corresponding icon. In this example, we also use void-icon to set the icon if it is unselected.

Read-only

Read-only Rate is for displaying rating score. Half star is supported.

Use attribute disabled to make the component read-only. Add show-score to display the rating score at the right side. Additionally, you can use attribute score-template to provide a score template. It must contain {value}, and {value} will be replaced with the rating score.

API

PROPS

Property
Type
Values
Description
default
Example
More
v-model
Number
Number
binding value.
0
id
String
String
native id attribute.
—
low-threshold
Number
Number
threshold value between low and medium level. The value itself will be included in low level.
2
high-threshold
Number
Number
threshold value between medium and high level. The value itself will be included in high level.
4
max
Number
Number
max rating score.
5
colors
Object
string[]Record:< number| string>
colors for icons. If array, it should have 3 elements, each of which corresponds with a score level, else if object, the key should be threshold value between two levels, and the value should be corresponding color
[ "#f7ba2a", "#f7ba2a", "#f7ba2a" ]
void-color
String
String
component of unselected icons.
#c6d1de
disabled-void-color
String
String
color of unselected read-only icons.
#eff2f7
icons
Object
string[]component[]Record< number,string | Component>
icon components. If array, it should have 3 elements, each of which corresponds with a score level, else if object, the key should be threshold value between two levels, and the value should be corresponding icon component.
[StarFilled, StarFilled, StarFilled]
void-icon
String
stringComponent
component of unselected icons.
Star
disabled-void-icon
String
stringComponent
component of unselected read-only icons.
StarFilled
disabled
Boolean
truefalse
whether Rate is read-only.
false
allow-half
Boolean
truefalse
whether picking half star is allowed.
false
show-text
Boolean
truefalse
whether to display texts.
false
show-score
Boolean
truefalse
whether to display current score. show-score and show-text cannot be true at the same time.
false
text-color
String
String
color of texts.
—
texts
array
String[]
text array
[Extremely bad, Disappointed, Fair, Satisfied, Surprise]
score-template
String
String
score template.
—
size
String
largemediumsmall
size of Rate.
medium
clearable
Boolean
truefalse
whether value can be reset to 0.
false
label
String
String
same as aria-label in Rate
—

EVENTS

Event
Type
Payload
Description
default
Example
More
change
Function
(value: number) => void
Triggers when rate value is changed.
—
—

EXPOSES

Method
Type
Parameters
Description
default
Example
More
setCurrentValue
Function
(value: number) => void
set current value.
—
—
resetCurrentValue
Function
(value: number) => void
reset current value.
—
—
Last Updated: 2026-10-28, 06:17:56 UTC
Copied