Rating

评分星级——只读时为可显示小数的图像,可交互时为可用键盘评分的单选组,可作为表单控件。

可用框架
  • Angular: 可用
  • Vue: 可用
  • React: 可用
  • React Native: 可用

用法

4.5 · 128 reviews
Your rating

Not rated yet · choose the same star again to clear.

导入

ts
import {
  SoneRatingComponent,
} from "@surface-one/angular/rating";

API 参考

SoneRatingComponent组件

Stars for a score. Read-only (`readonly`) it is one image named "4.5 out of 5" and fills fractions; interactive it is a native radio group — arrow keys move the score, every star is a labelled radio — and a ControlValueAccessor of `number` (0 = no rating).

选择器
sone-rating
输入
名称类型 默认值
value双向

The score, 0 to `max`. Fractions show only when read-only.

number0
maxnumber5
sizeRatingSize"default"
readonly

Show the score without letting it change.

booleanfalse
disabledbooleanfalse
clearable

Choosing the current score again clears it to 0.

booleanfalse
ariaLabel

The group's accessible name (interactive) or a prefix of the image's (read-only).

string | nullnull