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
MobileMobile Storybook
CodeGitlab

Rating Preview

Usage

import id.co.biofarma.binduiandroid.components.rating.Rating
Rating(
    variant = "stars",
    max = 5,
    readOnly = true,
    disabled = true,
    value = currentRating,
    onChange = { newRating ->
        currentRating = newRating
    },
)

Examples

Variant (optional)

Use variant rating by using stars or thumb icon.

Rating Example Variants


Mode (optional)

Use mode to use dark or light

Rating Example Mode


Props

PropsRequiredDefaultTypedescription
idfalse-stringA unique identifier for the rating.
variantfalsestarstar , thumbUnique identifier for ratings with a specific icon.
maxfalse5intThe indexes of the items to be added by default.
valuefalse-intValue with status rating whose status is active.
disabledfalsefalsebooleanIf true, rating will be set to disabled state.
readOnlyfalsefalsebooleanIf true, the rating will be set to viewed only.
onChangefalse-(Int) -> Unit = {}Callback function to run when the rating is clicked.
BIND © Biofarma Innovate Next-level Design .