# \[PLUGIN\] - StarRating Advanced + Customization

**URL:** <https://forum.bubble.io/t/plugin-starrating-advanced-customization/144937>\
**Category:** Showcase\
**Created:** [April 6, 2021, 5:53am UTC](https://forum.bubble.io/t/plugin-starrating-advanced-customization/144937 "2021-04-06T05:53:57Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![pork1977gm](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/pork1977gm/32/245627_2.png) [@pork1977gm](https://forum.bubble.io/u/pork1977gm)\
**Post date:** [April 6, 2021, 5:53am UTC](https://forum.bubble.io/t/plugin-starrating-advanced-customization/144937/1 "2021-04-06T05:53:57Z")

</div>

Hi all,

I’ve released an advanced version of a Star Rating control plugin which I’ve rammed with useful calculations, states, actions, events etc that I could think of.

It’s more of a user experience rating control I suppose since you don’t have to display stars. It contains a lot of configurable options which allow you to control things like the number of stars, the ratings, star sizes, precision values, star spacing, colours, max rating values plus more.

It utilises SVG images to render the ratings which make it very quick to use and the images are customizable too, so it’s possible to use your own SVG images if you don’t want to use the standard stars for example.

Here’s an image of some customized ratings…

![image](https://us1.discourse-cdn.com/bubble/original/3X/a/c/ac1253c02fe19becd807673230a4f82ffa87d38f.png)

Or you could stick with the standard stars…

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/5/8/58955893e12524b40272be3d7e685a3557a5dec2.png)

**PLUGIN**  
[Star Rating Advanced Plugin | Bubble](https://bubble.io/plugin/star-rating-advanced-1616927981014x233666657467498500)

**EDITOR**  
[Paul-testing-4 | Bubble Editor](https://bubble.io/page?type=page&name=star_rating&id=paul-testing-4&tab=tabs-1)

**DEMO**  
[https://paul-testing-4.bubbleapps.io/star\_rating](https://paul-testing-4.bubbleapps.io/star_rating)

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/f/d/fd927a5a70eca2bd669dcf5648f2285f8ac2df0e.png)

* * *

Outlined below are all the options, states, descriptions etc.

**ELEMENTS**

**Star Rating Advanced**  
This is the visual element dragged onto the page which contains the following field options.

- **Star width**  
_The width of each star, the width of a star is always equal to its height. Setting this value to 0 allows the star width to be auto calculated to fit the elements length. The elements height will also be adjusted to match the height of the stars._

- **Background fill color**  
_The background color for the un-rated part of a star._

- **Rated fill color**  
_The color for the rated part of a star._

- **Multi-color enable**  
_Enables star multi-color._

- **Start color**  
_Start star color when multi-color mode is enabled._

- **End color**  
_End star color when multi-color mode is enabled._

- **Number of stars**  
_Number of stars to use, to display the rating._

- **Rating**  
_Star rating, this value can be given in either percentage or number. You can use this to set a default rating when the element is initially displayed._

- **Max rating value**  
_The maximum value, you want the rating to end with._

- **Precision**  
_The precision value of the rating._

- **Steps (half/full)**  
_Rating will be displayed in steps of 0.5 (half) or 1 (full). To disable this, leave the field blank._

- **Spacing**  
_The amount of space between stars in pixels._

- **Right to Left**  
_Render the rating Right to Left._

- **Style**  
_Choose from a pre-set style of stars to display or select the Custom option where you can define your own star below in the Custom field. You can see these styles in the screenshots above._

- **Custom SVG**  
_Use this to define a custom shape to make up an image to display. The custom shape must be in the form of a SVG string and ideally have an aspect ratio of 1:1 so it displays correctly._  
_ **Scroll down this page to see an example of how you can set your own shapes.** _

* * *

**EXPOSED STATES**

- **Star width**  
Shows the width of each star.

- **Background fill color (hex)**  
Shows the background color of the star (hex).

- **Rated fill color (hex)**  
Shows the rated color of the star (hex).

- **Multi-color enable**  
Shows if multi-color is enabled or not.

- **Start color (hex)**  
Shows the start color when multi-color is enabled (hex).

- **End color (hex)**  
Shows the end color when multi-color is enabled (hex).

- **Background fill color (rgb)**  
Shows the background color of the star (rgb).

- **Rated fill color (rgb)**  
Shows the rated color of the star (rgb).

- **Start color (rgb)**  
Shows the start color when multi-color is enabled (rgb).

- **End color (rgb)**  
Shows the end color when multi-color is enabled (rgb).

- **Number of stars**  
Shows the number of stars displayed.

- **Rating max value**  
Shows the maximum value for the rating to end with.

- **Rating precision**  
Shows the precision of the rating.

- **Rating**  
Shows the rating value of the star control.

- **Error**  
Shows the last error that occurred.

- **Stars selected**  
Shows the number of stars that have been selected.

- **Steps**  
Shows the steps as half or full.

- **Spacing**  
Shows the amount of space between the stars.

- **Right to Left**  
Shows if the rating is rendered from Right to Left.

* * *

**EVENTS**

- **A Star Rating Advanced has errored**  
`Fired when an error as occurred.`

- **A Star Rating Advanced has been set**  
`Fired when the rating has been set.`

If you want more let me know.

* * *

**ACTIONS**

**Set star width on a star rating**  
Changes the width of a star.  
_-Star width_  
`The width of each star in pixels, the width of a star is always equal to its height. Setting this value to 0 allows the star width to be auto calculated to fit the elements length. The elements height will also be adjusted to match the height of the stars.`  
_-Resize element_  
`When this option is set to Yes, the elements width and height will be adjusted to fit.`

**Multi-color mode update on a star rating**  
Enables or disables multi-color mode.  
_-Enable_  
`Set the value to Yes to enable multi-color mode. Set the value to No to disable it.`  
_-Start color_  
`Sets the Start star color.`  
_-End color_  
`Sets the End star color.`

**Set star colors on a star rating**  
Sets the background and rated star colors.  
_-Background fill color_  
`The background color for the un-rated part of a star.`  
_-Rated fill color_  
`The color for the rated part of a star.`

**Set number of stars on a star rating**  
Set the number of stars to show.  
_-Number of stars_  
`Number of stars to show.`

**Set max rating value on a star rating**  
Set the maximum value for the rating to end with.  
_-Max rating value_  
`The maximum value, you want the rating to end with once the last star is selected.`

**Set precision of rating on a star rating**  
Set the precision value of the rating.  
_-Precision value_  
`The precision value of the rating.`

**Set rating on a star rating**  
Set the rating value for the star control.  
_-Rating value_  
`Star rating, this value can be given in either percentage or number. You can use this to load a default rating value which is set when the control is initially displayed.`

**Set steps on a star rating**  
Set the steps as half or full stars.  
_-Steps (half/full)_  
`Rating will be displayed in steps of 0.5 (half) or 1 (full). To disable this, leave the field blank.`

**Set spacing on a star rating**  
Set the amount of space between stars.  
_-Spacing_  
`The amount of space between stars in pixels.`

**Right to Left on a star rating**  
Render the rating Right to Left.  
_-Right to Left_  
`Render the rating Right to Left.`

**Change color specific star on a star rating**  
Experimental action - By default, after the color has been changed on the ‘rated’ part of a star, it will always revert back to it’s original color when hovered again to maintain the rating functionality. However, if you change the color on the ‘un-rated’ part of a star (background fill), it will stay set to that color even when hovered.  
_-Star number_  
`Enter the star number you want to change the color for. Note: Setting this number to a value higher than the amount of stars you have displayed, will target the first star.`  
_-Star color (rated)_  
`Choose a color for which you want the 'rated' part of a star to change to.`  
_-Star color (un-rated)_  
`Choose a color for which you want the 'un-rated' part of a star to change to.`

* * *

**CUSTOM STYLES**

The custom styles section becomes in use when the style dropdown option has been set “Custom”.

![image](https://us1.discourse-cdn.com/bubble/original/3X/7/0/700fbee254e11a15cebca5c40458cf61f729f3b4.png)

The Custom SVG text field should contain an SVG string. For example, you could enter the value below which would generate a box with a tick inside it.

`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0v24h24v-24h-24zm11 17l-5-5.299 1.399-1.43 3.574 3.736 6.572-7.007 1.455 1.403-8 8.597z"/></svg>`

![image](https://us1.discourse-cdn.com/bubble/original/3X/2/e/2e0e1385878c313b8a83205b8f9ca10a2f42c75f.png)

The shapes in this website ([https://iconmonstr.com/](https://iconmonstr.com/)) fit well with this plugin. You should choose shapes that ideally have an aspect ratio of 1:1 so it displays correctly. Once you’ve found a shape, agree to the license and then click the **\<Embed.\>** button which gives you the code to paste straight into the Custom SVG field.

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/5/9/598617e83f678110bbd4c5073ebbed68ca3ed495.png)

Hope you enjoy!  
Paul

---

<div class="post-metadata">

**Author:** ![cmarchan](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/cmarchan/32/253062_2.png) [@cmarchan](https://forum.bubble.io/u/cmarchan)\
**Post date:** [April 10, 2021, 11:47am UTC](https://forum.bubble.io/t/plugin-starrating-advanced-customization/144937/2 "2021-04-10T11:47:48Z")

</div>

Nice resource! @pork1977gm

---

<div class="post-metadata">

**Author:** ![pork1977gm](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/pork1977gm/32/245627_2.png) [@pork1977gm](https://forum.bubble.io/u/pork1977gm)\
**Post date:** [April 10, 2021, 11:48am UTC](https://forum.bubble.io/t/plugin-starrating-advanced-customization/144937/3 "2021-04-10T11:48:20Z")

</div>

Thanks!

---

<div class="post-metadata">

**Author:** ![taylar.ngo](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/taylar.ngo/32/74461_2.png) [@taylar.ngo](https://forum.bubble.io/u/taylar.ngo)\
**Post date:** [April 26, 2021, 7:18pm UTC](https://forum.bubble.io/t/plugin-starrating-advanced-customization/144937/4 "2021-04-26T19:18:46Z")

</div>

@pork1977gm  
Hi Paul,  
Can you explain to me better how this plugin sources data? I’ve looked at your doc and test editor and see that in the test you have a somewhat unconventional setup with 7 groups in the in the same cell of the repeating group. I have the StarRating in a group within a repeating group. The repeating group’s type is an object in the database, and the group which houses the StarRating has a type of the object’s Rating, which is a number between 0 and 5. I cannot get the stars to display anything besides the default “rating” on the plugin.

---

<div class="post-metadata">

**Author:** ![pork1977gm](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/pork1977gm/32/245627_2.png) [@pork1977gm](https://forum.bubble.io/u/pork1977gm)\
**Post date:** [April 26, 2021, 8:07pm UTC](https://forum.bubble.io/t/plugin-starrating-advanced-customization/144937/5 "2021-04-26T20:07:23Z")

</div>

Hi @taylar.ngo

So yes, that example of the different stars within that repeating group is a little strange!  
What I did there was to put 7 star elements all into the 1 cell and make each one not visible to start with. Each element then has a condition on it to say only become visible when the current cell’s number is 1,2,3,4,5,6 or 7. The RG’s data source is a list of numbers but I could have probably done the same thing with the current cell’s index instead.

I did it like that just to give an example of the star rating element working within a repeating group.  
Could you put up a few screenshots of how you have it configured? or perhaps I could take a look at how you have it setup through your editor? that would be best so I can see it.

I’ll fix it then.

---

<div class="post-metadata">

**Author:** ![gbenchanoch](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gbenchanoch/32/105761_2.png) [@gbenchanoch](https://forum.bubble.io/u/gbenchanoch)\
**Post date:** [July 26, 2021, 5:13am UTC](https://forum.bubble.io/t/plugin-starrating-advanced-customization/144937/7 "2021-07-26T05:13:24Z")

</div>

Hello! Loving this plugin. However, is there anyway to lock the StarRating as a “display only” rating? There are instances in which I will set the rating and others where I just want to display the rating. Is there any option for this? @pork1977gm

---

<div class="post-metadata">

**Author:** ![pork1977gm](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/pork1977gm/32/245627_2.png) [@pork1977gm](https://forum.bubble.io/u/pork1977gm)\
**Post date:** [July 26, 2021, 5:33am UTC](https://forum.bubble.io/t/plugin-starrating-advanced-customization/144937/8 "2021-07-26T05:33:46Z")

</div>

Hi @gbenchanoch thank you! I shall take a look or you, I think I added in an option somewhere to make it read only, I assume that’s what you what you mean right? So the value can’t be changed. If not I can always add that or you could just put a non-clickable transparent shape over it. I’ll check it anyway.

---

<div class="post-metadata">

**Author:** ![gbenchanoch](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gbenchanoch/32/105761_2.png) [@gbenchanoch](https://forum.bubble.io/u/gbenchanoch)\
**Post date:** [July 26, 2021, 12:57pm UTC](https://forum.bubble.io/t/plugin-starrating-advanced-customization/144937/9 "2021-07-26T12:57:26Z")

</div>

Thanks! I couldn’t find that option anywhere but if it exists that would be awesome. I try to avoid adding extra shapes as described.

---

<div class="post-metadata">

**Author:** ![pork1977gm](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/pork1977gm/32/245627_2.png) [@pork1977gm](https://forum.bubble.io/u/pork1977gm)\
**Post date:** [July 26, 2021, 2:16pm UTC](https://forum.bubble.io/t/plugin-starrating-advanced-customization/144937/10 "2021-07-26T14:16:11Z")

</div>

No probs!  
Update and you should now see this…

![image](https://us1.discourse-cdn.com/bubble/original/3X/c/5/c542b3b2d469285dd932c4cc7b938d805f33386a.png)

It disables all mouse events on the element.

---

<div class="post-metadata">

**Author:** ![gbenchanoch](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gbenchanoch/32/105761_2.png) [@gbenchanoch](https://forum.bubble.io/u/gbenchanoch)\
**Post date:** [July 26, 2021, 2:32pm UTC](https://forum.bubble.io/t/plugin-starrating-advanced-customization/144937/11 "2021-07-26T14:32:51Z")

</div>

Amazing thank you!

---

<div class="post-metadata">

**Author:** ![pork1977gm](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/pork1977gm/32/245627_2.png) [@pork1977gm](https://forum.bubble.io/u/pork1977gm)\
**Post date:** [July 26, 2021, 2:42pm UTC](https://forum.bubble.io/t/plugin-starrating-advanced-customization/144937/12 "2021-07-26T14:42:02Z")

</div>

Your welcome, let us know if there’s anything else.

---

<div class="post-metadata">

**Author:** ![gbenchanoch](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gbenchanoch/32/105761_2.png) [@gbenchanoch](https://forum.bubble.io/u/gbenchanoch)\
**Post date:** [July 26, 2021, 2:51pm UTC](https://forum.bubble.io/t/plugin-starrating-advanced-customization/144937/13 "2021-07-26T14:51:01Z")

</div>

Hi! It seems that the star rating element is defaulting to a very tall element. I’m not sure why it’s doing this. Any thoughts?

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/3/6/36bfe3f0316eef133096674928db0255b3a10219.png)

This is the element in the UI builder:

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/e/4/e47982a7def755cdc8f25abf2a7da5a97ff200a9.png)

This is the output:

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/d/1/d1004cd00274ab7c85b865ac16d5c7938b994a12.png)

EDIT:  
Dang, I completely missed the setting for star width. As you can see, my stars are all different. To accomplish this, I am using “1 star” as an SVG with a max score of 10. This allows me to treat this one star as 5 stars with 1/2 step increments. However, it seems that the width of this “1 star” is automatically changing the height to match it. Is it possible to over-ride that setting? Sorry for all these requests but I appreciate the work you’ve done!

---

<div class="post-metadata">

**Author:** ![pork1977gm](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/pork1977gm/32/245627_2.png) [@pork1977gm](https://forum.bubble.io/u/pork1977gm)\
**Post date:** [July 26, 2021, 4:54pm UTC](https://forum.bubble.io/t/plugin-starrating-advanced-customization/144937/14 "2021-07-26T16:54:57Z")

</div>

That’s ok. Can you show me the element settings you have and I will set it up the same and figure it out

---

<div class="post-metadata">

**Author:** ![gbenchanoch](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gbenchanoch/32/105761_2.png) [@gbenchanoch](https://forum.bubble.io/u/gbenchanoch)\
**Post date:** [July 26, 2021, 8:43pm UTC](https://forum.bubble.io/t/plugin-starrating-advanced-customization/144937/15 "2021-07-26T20:43:04Z")

</div>

![image](https://us1.discourse-cdn.com/bubble/original/3X/6/d/6de7bce892b158f8208a6d020c1cbd872d6ef980.png)

I am setting the entire SVG as one star and splitting it into 10 pieces (Max rating value is 10). This give the illusion of half stars.

I then save it as rating/2 to get a max of 5 stars and when I display it back, I display rating \*2.  
This issue with this is that the starrating element automatically sets the height the height of “1 star” and since all 5 of my stars are this 1 star, it sets the height to the width of my element.

Let me know if this makes sense.

---

<div class="post-metadata">

**Author:** ![pork1977gm](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/pork1977gm/32/245627_2.png) [@pork1977gm](https://forum.bubble.io/u/pork1977gm)\
**Post date:** [July 27, 2021, 12:52pm UTC](https://forum.bubble.io/t/plugin-starrating-advanced-customization/144937/16 "2021-07-27T12:52:22Z")

</div>

Ok I think I see what you’re doing here, the easiest option is for me to add another option in which allows you to specify whether you want the auto height/width to happen. Out of curiosity, what have you got the star width option set to? Having that set to 0 will make it auto calculate the height and width of the element but if you set it to something like 40, you may find that will fix your issue. Let me know anyway.

---

<div class="post-metadata">

**Author:** ![gbenchanoch](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gbenchanoch/32/105761_2.png) [@gbenchanoch](https://forum.bubble.io/u/gbenchanoch)\
**Post date:** [July 27, 2021, 1:45pm UTC](https://forum.bubble.io/t/plugin-starrating-advanced-customization/144937/17 "2021-07-27T13:45:52Z")

</div>

I had it set to 0 and I tried 40 but it just made the stars tiny. Thanks again for your help!

---

<div class="post-metadata">

**Author:** ![pork1977gm](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/pork1977gm/32/245627_2.png) [@pork1977gm](https://forum.bubble.io/u/pork1977gm)\
**Post date:** [July 27, 2021, 5:53pm UTC](https://forum.bubble.io/t/plugin-starrating-advanced-customization/144937/18 "2021-07-27T17:53:14Z")

</div>

Ok, give us a bit and I’ll get back to you once I’ve added in the option. Sorry for the delay, been busy working on something else which I have to get finished first.

---

<div class="post-metadata">

**Author:** ![gbenchanoch](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gbenchanoch/32/105761_2.png) [@gbenchanoch](https://forum.bubble.io/u/gbenchanoch)\
**Post date:** [July 27, 2021, 6:00pm UTC](https://forum.bubble.io/t/plugin-starrating-advanced-customization/144937/19 "2021-07-27T18:00:26Z")

</div>

No rush! I appreciate you making these customizations!

---

<div class="post-metadata">

**Author:** ![pork1977gm](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/pork1977gm/32/245627_2.png) [@pork1977gm](https://forum.bubble.io/u/pork1977gm)\
**Post date:** [July 27, 2021, 9:05pm UTC](https://forum.bubble.io/t/plugin-starrating-advanced-customization/144937/20 "2021-07-27T21:05:46Z")

</div>

Hey @gbenchanoch  
Would you mind sending me over the custom SVG you have? I’ve added the option to disable the automatic height calculation but I just wanted to see how your SVG displays before I push the update. Make sure all is good.

---

<div class="post-metadata">

**Author:** ![pork1977gm](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/pork1977gm/32/245627_2.png) [@pork1977gm](https://forum.bubble.io/u/pork1977gm)\
**Post date:** [July 28, 2021, 6:02am UTC](https://forum.bubble.io/t/plugin-starrating-advanced-customization/144937/21 "2021-07-28T06:02:41Z")

</div>

Ok, do you want to try it now. You’ll see this option below to disable the automatic height setting of the element, I’m hoping it will fix it.

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/d/f/df47b2aae25634fd51f744cb37d8d97614ef9d17.png)

[Next page](https://forum.bubble.io/t/plugin-starrating-advanced-customization/144937.md?page=2)
