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.
| Type | Resource |
|---|---|
| Design | Figma |
| Web | Web Storybook |
| Code | Gitlab |
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
| Props | Required | Default | Type | description |
|---|---|---|---|---|
| mode | false | light | light dark | The theme mode of the rating (light or dark). |
| max | false | 5 | number | The indexes of the items to be added by default. |
| value | false | - | number | Value with status rating whose status is active. |
| variant | false | star | star , thumb | Unique identifier for ratings with a specific icon. |
| disabled | false | false | boolean | If true, rating will be set to disabled state. |
| readOnly | false | false | boolean | If true, the rating will be set to viewed only. |
| allowReset | false | true | boolean | If false, the selected rating will be reset to the default view. |
| style | false | - | CSSProperties | Custom styles for the rating component. |
| id | false | - | string | A unique identifier for the rating. |
| name | false | - | string | Name for the rating. |
| onChange | false | - | (value: number) => void | Callback function to run when the rating is clicked. |