Star Rating

A simple star rating component.

Basic

The <StarRating/> component builds on top of the bits-ui <RatingGroup/> component so it has all the behaviors you'd expect.

Rating is 0

Installation

jsrepo add ui/star-rating

Usage

Custom Stars

You can have an arbitrary number of stars.

Half Rating

You can also have half ratings. And they even work in RTL!

Rating is 3.5
تقييم بالنجوم (RTL)

Disabled

Readonly

Custom Color

Custom Size

API Reference

StarRating.

Root

The root component for the Star Rating. Forwards all props and behavior to bits-ui RatingGroup.Root.

StarRating.

Star

A single star in the Star Rating component. Used internally to render each star with its state.

PropTypeDefault
index?
number -
state?
enum -
class?
string -