Skip to content

Rate ​

Star rating. The default is five stars, half-star steps, and click-again to clear. Filled stars use the brand gold; empty stars stay a neutral outline.

Demos ​

Basic

Half stars are on by default. Clicking the current value clears it to 0. Hover previews with --gk-color-brand-hover.
3.5

Cleared

Sizes

Glyphs are 16 / 22 / 28. The hit box stays at least 28px tall.

Readonly and disabled

Whole stars

In Vue, set .allowHalf="false". A bare allow-half="false" attribute is still true.

API ​

Properties ​

NameTypeDefaultNotes
valuenumber00 is cleared
countnumber5
allow-halfbooleantrue
allow-clearbooleantrueClick the current value again
sizesm | md | lgmd
colorstringbrandFilled color. Empty stays neutral
readonly / disabledbooleanfalse
namestring—

Events ​

change and update:value with { value }.

Parts ​

root, item, icon, half, full. The group is a radiogroup labelled 評分 / Rating. Each stop is a radio. A custom character slot is a follow-up.