React SDK

Rating

The Rating component is used to display ratings using stars or custom indicators.

Usage

Editable Example

Maxium stars

Editable Example

Half star

Editable Example

Custom icon

Editable Example

Copywriting

Editable Example

Direction

Editable Example

Unit

Editable Example

Accessibility

  • Container has role img and corresponding label e.g "Rating: 2 out of 5 stars".
  • Children has hidden true
  • aria-setsize = count and aria-posinset = index + 1

Props

NameTypeDefaultDescription
valuenumberThe value of this rating
maxnumber5The maximum rating.
childrenReact.ReactNodenullChildren for copywriting.
characterReact.ReactNode | React.FC<{index, count}><Star/>The component used to render rating.
direction'ltr' | 'rtl''ltr'
unitstring'star'Singular form, used in label to convey more accurately.