Flutter docs
Default skin

Rate

Used for rating operation on something.

When to use

  • Show evaluation.
  • A quick rating operation on something.

Examples

Basic

The simplest usage.

Half star

Support select half star.

Read only

Read only, can't use mouse to interact.

Other Character

Replace the default star to other character like alphabet, digit, iconfont or even Chinese word.

Sizes

Three sizes.

Show copywriting

Add copywriting in rate components.

Clear star

Allow clearing the rating when clicking the same star again.

Customize character

Can customize each character using (RateProps) => ReactNode.

API

Rate are exported from @ceebee/ui/client.

Rate

PropertyDescriptionTypeDefaultVersion
allowClearWhether to allow clear when click againbooleantrue—
allowHalfWhether to allow semi selectionbooleanfalse—
characterThe custom character of rateReactNode | (RateProps) => ReactNode<StarFilled />function(): 4.4.0
countStar countnumber5—
defaultValueThe default valuenumber0—
disabledIf read only, unable to interactbooleanfalse—
keyboardSupport keyboard operationbooleantrue5.18.0
sizeStar size'small' | 'medium' | 'large''medium'—
tooltipsCustomize tooltip by each characterTooltipProps[] | string\[]-—
valueThe current valuenumber-—
onBlurCallback when component lose focusfunction()-—
onChangeCallback when select valuefunction(value: number)-—
onFocusCallback when component get focusfunction()-—
onHoverChangeCallback when hover itemfunction(value: number)-—
onKeyDownCallback when keydown on componentfunction(event)-—
blur()Remove focus———
focus()Get focus———