# How to add star ratings in builder.io?

**URL:** <https://forum.builder.io/t/how-to-add-star-ratings-in-builder-io/2876>\
**Category:** Technical Questions\
**Tags:** styling\
**Created:** [November 14, 2022, 8:22am UTC](https://forum.builder.io/t/how-to-add-star-ratings-in-builder-io/2876 "2022-11-14T08:22:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ramiz](https://avatars.discourse-cdn.com/v4/letter/r/ec9cab/32.png) [@ramiz](https://forum.builder.io/u/ramiz)\
**Post date:** [November 14, 2022, 8:22am UTC](https://forum.builder.io/t/how-to-add-star-ratings-in-builder-io/2876/1 "2022-11-14T08:22:05Z")

</div>

**Star rating**  
_How to add star rating using builder like we have an option in Elementor for star rating and changing the values_

---

<div class="post-metadata">

**Author:** ![manish-sharma](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@manish-sharma](https://forum.builder.io/u/manish-sharma)\
**Post date:** [November 14, 2022, 2:48pm UTC](https://forum.builder.io/t/how-to-add-star-ratings-in-builder-io/2876/2 "2022-11-14T14:48:12Z")

</div>

Hi @ramiz!

Welcome to the [builder.io](http://builder.io) forum.

To create a rating star component, you can use [builder data models](https://www.builder.io/c/docs/integrate-cms-data) that can accept the input field[number] for the rating value.

Or else if you are going to fetch the rating stars count from an external source, you can use the below javascript code to render the rating stars

```auto
//ratings could be a dynamic data object or an array 
let itemsLen = state.ratings.items.length;
for(let i = 0; i < itemsLen; i++){   
  let rating_stars = [];   
  for(let j=0; j< parseInt(state.ratings.items[i].rating_score); j++){     
    rating_stars[j] = state.star_img; // state.star_img can be a star image or any review.    
  }   
 state.ratings.items[i].rating_stars = rating_stars;
} 

```

Then you can use the builder repeatForEach feature to loop through the `state.ratings` and render the stars.

Let us know if have any further questions. Thank you!
