Star Rating custom component

I needed a small project to decompress, and there’d been some interest in a star rating custom component that supported input, so I put some time into creating it. It no doubt doesn’t support all the features everyone would want, but it gives a starting point for people to customize.

star_rating

Ratings can be set via code to half amounts, but the user can only set ratings on whole amounts.

The component can be set to editable or not, and the size and color of the stars and background is customizable.

https://anvil.works/build#clone:425FR24FERWHALKB=EWDTFUKRCE5AENAIYCC6MTEE

Credit goes to @robert for the original code to display star ratings via Font Awesome icons: Star ratings with icons!

Disclaimer: I don’t normally create custom components based on forum posts, this just happened to coincide with a need of mine.

7 Likes

this is great. thanks! :slight_smile:

2 Likes

I took inspiration from you guys and decided to make my own star rating component my star rating component
It can be customized as follows:

  • max number of stars
  • foreground color
  • allow half ratings (enable you to increment or decrement rating in half steps by clicking)

This was 3 hours of work but was fun ;).

See result here if you dont wanna clone.

4 Likes