Docs
Star rating
Star rating
Use to show ratings of products as well as taking input for rating
Installation
npx nyxbui@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
Property | Description | Default |
---|---|---|
value | The value of the stars | - |
setValue | A function to set the value of the stars | - |
numStars | Number of stars to render | 5 |
icon | The icon to use for the stars | - |
disabled | Prevents setting values, lower the opacity and disable hover | false |
wrapperProps | Additional props for the wrapper div | - |
iconProps | Additional props for the icon component | - |
showcase | Prevents setting values and hover (does not affect opacity) | false |
Every property is optional*