Rating

The icons represent the average object rating value through several states: on, off, and half. The states of these icons depict a rating from a scale of one to five.

TypeResource
DesignFigma
WebWeb Storybook
CodeGitlab

Usage

import { Rating } from 'bio-bind-ui';
<Rating
  allowReset
  id='rating'
  max={5}
  mode='light'
  name='rating'
  onChange={() => {}}
  style={{}}
  value={0}
  variant='star'
/>

Examples

Mode (optional)

Use mode to use dark or light


Variant (optional)

Use variant rating by using stars or thumb icon.


Props

PropsRequiredDefaultTypedescription
modefalselightlight darkThe theme mode of the rating (light or dark).
maxfalse5numberThe indexes of the items to be added by default.
valuefalse-numberValue with status rating whose status is active.
variantfalsestarstar , thumbUnique identifier for ratings with a specific icon.
disabledfalsefalsebooleanIf true, rating will be set to disabled state.
readOnlyfalsefalsebooleanIf true, the rating will be set to viewed only.
allowResetfalsetruebooleanIf false, the selected rating will be reset to the default view.
stylefalse-CSSPropertiesCustom styles for the rating component.
idfalse-stringA unique identifier for the rating.
namefalse-stringName for the rating.
onChangefalse-(value: number) => voidCallback function to run when the rating is clicked.
BIND © Biofarma Innovate Next-level Design .