
Hello #Trailblazers,
In this blog post, we are going to talk how to create the rating component using Lightning Web Component
There are many use cases when we need to develop the rating component to display the rating for example survey result, interview feedback.
Create a Static resource and name it fivestar and you can get the Static Resource. Five Star Rating
Now, once you have create the Static resource, it’s time to Create the Rating Component.
Call the component from the parent component like below
<div >
<lightning-tile label="Salesforce" href="JavaScript:void(0);" type="media">
<c-five-star-rating value="5" onratingchange={handleRatingChanged} ></c-five-star-rating>
</lightning-tile>
</div>
<!--
@description :
@author : Amit Singh
@group :
@last modified on : 12-18-2020
@last modified by : Amit Singh
Modifications Log
Ver Date Author Modification
1.0 12-18-2020 Amit Singh Initial Version
-->
<template>
<lightning-card title='Skill Set'>
<div class="slds-m-top_medium slds-m-bottom_x-small">
<div >
<lightning-tile label="Salesforce" href="JavaScript:void(0);" type="media">
<c-five-star-rating value="5" onratingchange={handleRatingChanged} ></c-five-star-rating>
</lightning-tile>
</div>
<div>
<lightning-tile label="Integration" href="JavaScript:void(0);" type="media">
<c-five-star-rating value="5" ></c-five-star-rating>
</lightning-tile>
</div>
<div>
<lightning-tile label="Lightning Development" href="JavaScript:void(0);" type="media">
<c-five-star-rating value="5" ></c-five-star-rating>
</lightning-tile>
</div>
<div >
<lightning-tile label="Admin" href="JavaScript:void(0);" type="media">
<c-five-star-rating value="5" ></c-five-star-rating>
</lightning-tile>
</div>
<div>
<lightning-tile label="Communities" href="JavaScript:void(0);" type="media">
<c-five-star-rating value="4" ></c-five-star-rating>
</lightning-tile>
</div>
<div>
<lightning-tile label="CI/CD" href="JavaScript:void(0);" type="media">
<c-five-star-rating value="4" ></c-five-star-rating>
</lightning-tile>
</div>
<div >
<lightning-tile label="Project Management" href="JavaScript:void(0);" type="media">
<c-five-star-rating value="3.5" ></c-five-star-rating>
</lightning-tile>
</div>
<div >
<lightning-tile label="MuleSoft" href="JavaScript:void(0);" type="media">
<c-five-star-rating value="3" ></c-five-star-rating>
</lightning-tile>
</div>
</div>
</lightning-card>
</template>
Now, as you have created the feedback component. You can add your component to either Aura Application, OR Lightning Pages to see the outcome. Refer below image

Thanks for reading
#Salesforce #DeveloperGeeks
Please like, share & Subscribe the Blog Post and YouTube Channel