❤️ Support our project - Your donation helps us continue developing awesome tools!


Docs
Star rating

Star rating

Use to show ratings of products as well as taking input for rating

Installation

npx nyxb@latest add star-rating

Usage

import { StarRating } from "~/components/ui/star-rating"
const [value, setValue] = React.useState(3)
 
<StarRating value={value} setValue={setValue} />

Colored icons

Different icon

API Reference

PropertyDescriptionDefault
valueThe value of the stars-
setValueA function to set the value of the stars-
numStarsNumber of stars to render5
iconThe icon to use for the stars-
disabledPrevents setting values, lower the opacity and disable hoverfalse
wrapperPropsAdditional props for the wrapper div-
iconPropsAdditional props for the icon component-
showcasePrevents setting values and hover (does not affect opacity)false

Every property is optional*