Use the rating component to show reviews and testimonials from your users using stars and scores based on multiple styles and sizes
Get started with the rating component to show an aggregate of reviews and scores in the forms of stars or numbers.
You can find multiple examples on this page including different styles, sizes, and variants of the rating component and other associated elements such as a comment or card.
You can use the Star component with the id and fillPercent props.
Svelte
<script>import{ Star }from'flowbite-svelte';</script><Starsize={50}id="0"fillPercent={0}/><Starsize={50}id="10"fillPercent={10}/><Starsize={50}id="20"fillPercent={20}/><Starsize={50}id="30"fillPercent={30}/><Starsize={50}id="40"fillPercent={40}/><Starsize={50}id="50"fillPercent={50}/><Starsize={50}id="60"fillPercent={60}/><Starsize={50}id="70"fillPercent={70}/><Starsize={50}id="80"fillPercent={80}/><Starsize={50}id="90"fillPercent={90}/><Starsize={50}id="100"fillPercent={100}/>
Set the total,rating, and ratings prop for AdvancedRation component. Use the rating slot for Rating component with the total and rating props. Use the globalText slot for additional information.
3.72 out of 5
1,745 global ratings
5 star
70%
4 star
17%
3 star
8%
2 star
4%
1 star
1%
Svelte
<script>import{ AdvancedRating, Rating }from'flowbite-svelte';</script><AdvancedRatingratings={[{label:'5 star',rating:70},{label:'4 star',rating:17},{label:'3 star',rating:8},{label:'2 star',rating:4},{label:'1 star',rating:1}]}><spanslot="rating"><Ratingtotal={5}rating={3.72}id="example-8"><pslot="text"class="text-sm font-medium text-gray-500 dark:text-gray-400 ml-2">3.72 out of 5</p></Rating></span><pslot="globalText"class="mt-2 text-sm font-medium text-gray-500 dark:text-gray-400">1,745 global ratings</p></AdvancedRating>
Use this component to show a single rating comment and its score alongside other components such as the user profile avatar, name, post date, and more.
Jese Leos
4.5 out of 5
Thinking to buy another one!
This is my third Invicta Pro Diver. They are just fantastic value for money. This one arrived yesterday and the first thing I did was set the time, popped on an identical strap from another Invicta and went in the shower with it to test the waterproofing.... No problems.
It is obviously not the same build quality as those very expensive watches. But that is like comparing a Citroën to a Ferrari. This watch was well under £100! An absolute bargain.
<script>import{ RatingComment }from'flowbite-svelte';let comment ={id:'1',user:{name:'Jese Leos',img:{src:'/images/profile-picture-2.webp',alt:'Jese Leos'},joined:'Joined on August 2014'},total:5,rating:4.5,heading:'Thinking to buy another one!',address:'the UK',datetime:'2022-03-25'};</script><RatingComment{comment}helpfullink="/"abuselink="/"><pclass="mb-2 font-light text-gray-500 dark:text-gray-400">This is my third Invicta Pro Diver. They are just fantastic value for money. This one arrived yesterday and the first thing I did was set the time, popped on an identical strap from another Invicta and went in the shower with it to test the waterproofing.... No problems.</p><pclass="mb-3 font-light text-gray-500 dark:text-gray-400">It is obviously not the same build quality as those very expensive watches. But that is like comparing a Citroën to a Ferrari. This watch was well under £100! An absolute bargain.</p><ahref="/"class="block mb-5 text-sm font-medium text-primary-600 hover:underline dark:text-primary-500"> Read more </a><svelte:fragmentslot="evaluation">19 people found this helpful</svelte:fragment></RatingComment>
Use this component to show the review content from a user alongside the avatar, location, details, and the score inside a card element.
Jese Leos
Apartament with City View
3 nights December 2021
Family
Spotless, good appliances, excellent layout, host was genuinely nice and helpful.
8.79
The flat was spotless, very comfortable, and the host was amazing. I highly recommend this accommodation for anyone visiting Brasov city centre. It's quite a while since we are no longer using hotel facilities but self contained places. And the main reason is poor cleanliness and staff not being trained properly. This place exceeded our expectation and will return for sure.
It is obviously not the same build quality as those very expensive watches. But that is like comparing a Citroën to a Ferrari. This watch was well under £100! An absolute bargain.
Svelte
<script>import{ Review }from'flowbite-svelte';import{ LandmarkSolid, CalendarMonthSolid, UsersGroupOutline, ThumbsUpSolid, ThumbsDownSolid }from'flowbite-svelte-icons';let review ={name:'Jese Leos',imgSrc:'/images/profile-picture-2.webp',imgAlt:'jese leos',address:'United States',reviewDate:'January 20, 2022',title:'Spotless, good appliances, excellent layout, host was genuinely nice and helpful.',rating:8.79,item1:'Apartament with City View',item2:'3 nights December 2021',item3:'Family'};</script><Review{review}><pclass="mb-2 font-light text-gray-500 dark:text-gray-400">The flat was spotless, very comfortable, and the host was amazing. I highly recommend this accommodation for anyone visiting Brasov city centre. It's quite a while since we are no longer using hotel facilities but self contained places. And the main reason is poor cleanliness and staff not being trained properly. This place exceeded our expectation and will return for sure.</p><pclass="mb-5 font-light text-gray-500 dark:text-gray-400">It is obviously not the same build quality as those very expensive watches. But that is like comparing a Citroën to a Ferrari. This watch was well under £100! An absolute bargain.</p><svelte:fragmentslot="item1"><LandmarkSolidclass="w-3 h-3 mr-2"/>{review.item1}</svelte:fragment><svelte:fragmentslot="item2"><CalendarMonthSolidclass="w-3 h-3 mr-2"/>{review.item2}</svelte:fragment><svelte:fragmentslot="item3"><UsersGroupOutlineclass="w-3 h-3 mr-2"/>{review.item3}</svelte:fragment><asideclass="flex items-center mt-3 space-x-5"><ahref="/"class="inline-flex items-center text-sm font-medium text-primary-600 hover:underline dark:text-primary-500"><ThumbsUpSolidclass="w-3.5 h-3.5 mr-2.5 text-primary-600 dark:text-primary-500"/>
Helpful
</a><ahref="/"class="inline-flex items-center text-sm font-medium text-primary-600 hover:underline dark:text-primary-500 group"><ThumbsDownSolidclass="w-3.5 h-3.5 mr-2.5 text-primary-600 dark:text-primary-500"/>
Not helpful
</a></aside></Review>