Skip to content

pseudoankit/ratingbar-compose

Repository files navigation

Library to create ratingbar in compose

Maven Central

Getting Started

Add the dependency in your build.gradle

dependencies { implementation 'io.github.pseudoankit:rating-bar:<version 🔝>' }

Usage

    var ratingIconIndex by remember { mutableStateOf(0) }
    RatingBar(
        config = RatingBarConfig(
            iconConfig = RatingBarIconConfig(
                ratingIcon = android.R.drawable.btn_star_big_off,
                activeColor = Color.Yellow,
                inactiveColor = Color.Gray
            ),
            activeIconIndex = ratingIcon
        ),
    ) { activeRatingIndex -> 
        ratingIconIndex = activeRatingIndex
    }