|$ curl https://forge-ai.dev/api/markdown?path=docs/components/rating
$cat docs/rating.md
updated Recently·16 min read·published

Rating

CSSHTMLTailwindBootstrapUIInteractiveIntermediate🎯Free Tools
Introduction

Rating components let users view or provide a score. This guide covers production-ready patterns in plain HTML/CSS, Tailwind CSS, and Bootstrap — including five-star display, half-star precision, interactive selection, custom SVG icons, sizes, review breakdowns, color variants, and accessibility.

info

Always pair star visuals with a visible numeric score or an aria-label describing the value. Color-blind users may not distinguish filled stars from empty ones.
Basic Star Rating

Standard five-star rating display using a CSS custom property --rating with a linear gradient. Filled stars indicate the score, empty stars show the remaining range. Pure CSS with no JavaScript required for read-only display.

basic-star-rating
Live
untitled.html
HTML
1<div class="rating-demo">
2 <div class="rating-group">
3 <span class="stars" style="--rating:5" aria-label="5 out of 5 stars">
4 ★★★★★
5 </span>
6 <span class="rating-value">
7 5.0
8 </span>
9 <span class="rating-text">
10 Excellent
11 </span>
12 </div>
13 <div class="rating-group">
14 <span class="stars" style="--rating:4" aria-label="4 out of 5 stars">
15 ★★★★★
16 </span>
17 <span class="rating-value">
18 4.0
19 </span>
20 <span class="rating-text">
21 Very Good
22 </span>
23 </div>
24 <div class="rating-group">
25 <span class="stars" style="--rating:3" aria-label="3 out of 5 stars">
26 ★★★★★
27 </span>
28 <span class="rating-value">
29 3.0
30 </span>
31 <span class="rating-text">
32 Good
33 </span>
34 </div>
35 <div class="rating-group">
36 <span class="stars" style="--rating:2.5" aria-label="2.5 out of 5 stars">
37 ★★★★★
38 </span>
39 <span class="rating-value">
40 2.5
41 </span>
42 <span class="rating-text">
43 Fair
44 </span>
45 </div>
46 <div class="rating-group">
47 <span class="stars" style="--rating:1" aria-label="1 out of 5 stars">
48 ★★★★★
49 </span>
50 <span class="rating-value">
51 1.0
52 </span>
53 <span class="rating-text">
54 Poor
55 </span>
56 </div>
57</div>
preview
Interactive Rating

Clickable star rating with hover preview. Hovering over a star highlights all stars up to that position. Clicking sets the value and displays a text label. Uses inline SVG stars and the ARIA radio group pattern for accessibility.

interactive-rating
Live
untitled.html
HTML
1<div class="interactive-rating-wrap">
2 <div class="star-rating" id="star-rating" role="radiogroup" aria-label="Rate this product">
3 <button class="star" data-value="1" aria-label="1 star" role="radio" aria-checked="false">
4 <svg viewBox="0 0 24 24" width="28" height="28" fill="currentColor">
5 <path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/>
6 </svg>
7 </button>
8 <button class="star" data-value="2" aria-label="2 stars" role="radio" aria-checked="false">
9 <svg viewBox="0 0 24 24" width="28" height="28" fill="currentColor">
10 <path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/>
11 </svg>
12 </button>
13 <button class="star" data-value="3" aria-label="3 stars" role="radio" aria-checked="false">
14 <svg viewBox="0 0 24 24" width="28" height="28" fill="currentColor">
15 <path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/>
16 </svg>
17 </button>
18 <button class="star" data-value="4" aria-label="4 stars" role="radio" aria-checked="false">
19 <svg viewBox="0 0 24 24" width="28" height="28" fill="currentColor">
20 <path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/>
21 </svg>
22 </button>
23 <button class="star" data-value="5" aria-label="5 stars" role="radio" aria-checked="false">
24 <svg viewBox="0 0 24 24" width="28" height="28" fill="currentColor">
25 <path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/>
26 </svg>
27 </button>
28 </div>
29 <p class="rating-label" id="rating-output">
30 Click a star to rate
31 </p>
32</div>
preview
Half-Star Precision

Half-star ratings for more precise scoring. Each star splits into two clickable halves using CSS clip-path. The left half sets a .5 value, the right half sets the full integer, giving 10 discrete rating levels.

half-star-rating
Live
untitled.html
HTML
1<div class="half-demo">
2 <div class="half-stars" id="half-rating" aria-label="Rate 3.5 out of 5">
3 <button class="half-star left" data-val="0.5" aria-label="0.5">
4
5 </button>
6 <button class="half-star right" data-val="1" aria-label="1">
7
8 </button>
9 <button class="half-star left" data-val="1.5" aria-label="1.5">
10
11 </button>
12 <button class="half-star right" data-val="2" aria-label="2">
13
14 </button>
15 <button class="half-star left active" data-val="2.5" aria-label="2.5">
16
17 </button>
18 <button class="half-star right active" data-val="3" aria-label="3">
19
20 </button>
21 <button class="half-star left active" data-val="3.5" aria-label="3.5">
22
23 </button>
24 <button class="half-star right" data-val="4" aria-label="4">
25
26 </button>
27 <button class="half-star left" data-val="4.5" aria-label="4.5">
28
29 </button>
30 <button class="half-star right" data-val="5" aria-label="5">
31
32 </button>
33 </div>
34 <p class="half-output">
35 3.5 / 5
36 </p>
37</div>
preview
Custom SVG Icons

Replace stars with inline SVG icons — hearts for favorites, thumbs for likes, or flames for trending. The gradient clip technique also works with text characters, but SVG icons stay crisp at every size and can be filled programmatically.

custom-icon-rating
Live
untitled.html
HTML
1<div class="custom-rating-demo">
2 <div class="custom-group">
3 <span class="heart-stars" style="--rating:4" aria-label="4 out of 5">
4 ♥♥♥♥♥
5 </span>
6 <span class="custom-label">
7 Favorite
8 </span>
9 </div>
10 <div class="custom-group">
11 <span class="svg-hearts" aria-label="4 out of 5">
12 <svg viewBox="0 0 24 24" fill="#EF4444" width="20" height="20">
13 <path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/>
14 </svg>
15 <svg viewBox="0 0 24 24" fill="#EF4444" width="20" height="20">
16 <path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/>
17 </svg>
18 <svg viewBox="0 0 24 24" fill="#EF4444" width="20" height="20">
19 <path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/>
20 </svg>
21 <svg viewBox="0 0 24 24" fill="#EF4444" width="20" height="20">
22 <path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/>
23 </svg>
24 <svg viewBox="0 0 24 24" fill="#333" width="20" height="20">
25 <path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/>
26 </svg>
27 </span>
28 <span class="custom-label">
29 SVG Hearts
30 </span>
31 </div>
32 <div class="custom-group">
33 <span class="svg-thumbs" aria-label="3 out of 5">
34 <svg viewBox="0 0 24 24" fill="#3B82F6" width="20" height="20">
35 <path d="M1 21h4V9H1v12zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-1.91z"/>
36 </svg>
37 <svg viewBox="0 0 24 24" fill="#3B82F6" width="20" height="20">
38 <path d="M1 21h4V9H1v12zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-1.91z"/>
39 </svg>
40 <svg viewBox="0 0 24 24" fill="#3B82F6" width="20" height="20">
41 <path d="M1 21h4V9H1v12zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-1.91z"/>
42 </svg>
43 <svg viewBox="0 0 24 24" fill="#333" width="20" height="20">
44 <path d="M1 21h4V9H1v12zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-1.91z"/>
45 </svg>
46 <svg viewBox="0 0 24 24" fill="#333" width="20" height="20">
47 <path d="M1 21h4V9H1v12zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-1.91z"/>
48 </svg>
49 </span>
50 <span class="custom-label">
51 Thumbs Up
52 </span>
53 </div>
54 <div class="custom-group">
55 <span class="svg-flames" aria-label="5 out of 5">
56 <svg viewBox="0 0 24 24" fill="#F97316" width="20" height="20">
57 <path d="M13.5.67s.74 2.65.74 4.8c0 2.06-1.35 3.73-3.41 3.73-2.07 0-3.63-1.67-3.63-3.73l.03-.36C5.21 7.51 4 10.62 4 14c0 4.42 3.58 8 8 8s8-3.58 8-8C20 8.61 17.41 3.8 13.5.67zM11.71 19c-1.78 0-3.22-1.4-3.22-3.14 0-1.62 1.05-2.76 2.81-3.12 1.77-.36 3.6-1.21 4.62-2.58.39 1.29.59 2.65.59 4.04 0 2.65-2.15 4.8-4.81 4.8z"/>
58 </svg>
59 <svg viewBox="0 0 24 24" fill="#F97316" width="20" height="20">
60 <path d="M13.5.67s.74 2.65.74 4.8c0 2.06-1.35 3.73-3.41 3.73-2.07 0-3.63-1.67-3.63-3.73l.03-.36C5.21 7.51 4 10.62 4 14c0 4.42 3.58 8 8 8s8-3.58 8-8C20 8.61 17.41 3.8 13.5.67zM11.71 19c-1.78 0-3.22-1.4-3.22-3.14 0-1.62 1.05-2.76 2.81-3.12 1.77-.36 3.6-1.21 4.62-2.58.39 1.29.59 2.65.59 4.04 0 2.65-2.15 4.8-4.81 4.8z"/>
61 </svg>
62 <svg viewBox="0 0 24 24" fill="#F97316" width="20" height="20">
63 <path d="M13.5.67s.74 2.65.74 4.8c0 2.06-1.35 3.73-3.41 3.73-2.07 0-3.63-1.67-3.63-3.73l.03-.36C5.21 7.51 4 10.62 4 14c0 4.42 3.58 8 8 8s8-3.58 8-8C20 8.61 17.41 3.8 13.5.67zM11.71 19c-1.78 0-3.22-1.4-3.22-3.14 0-1.62 1.05-2.76 2.81-3.12 1.77-.36 3.6-1.21 4.62-2.58.39 1.29.59 2.65.59 4.04 0 2.65-2.15 4.8-4.81 4.8z"/>
64 </svg>
65 <svg viewBox="0 0 24 24" fill="#F97316" width="20" height="20">
66 <path d="M13.5.67s.74 2.65.74 4.8c0 2.06-1.35 3.73-3.41 3.73-2.07 0-3.63-1.67-3.63-3.73l.03-.36C5.21 7.51 4 10.62 4 14c0 4.42 3.58 8 8 8s8-3.58 8-8C20 8.61 17.41 3.8 13.5.67zM11.71 19c-1.78 0-3.22-1.4-3.22-3.14 0-1.62 1.05-2.76 2.81-3.12 1.77-.36 3.6-1.21 4.62-2.58.39 1.29.59 2.65.59 4.04 0 2.65-2.15 4.8-4.81 4.8z"/>
67 </svg>
68 <svg viewBox="0 0 24 24" fill="#F97316" width="20" height="20">
69 <path d="M13.5.67s.74 2.65.74 4.8c0 2.06-1.35 3.73-3.41 3.73-2.07 0-3.63-1.67-3.63-3.73l.03-.36C5.21 7.51 4 10.62 4 14c0 4.42 3.58 8 8 8s8-3.58 8-8C20 8.61 17.41 3.8 13.5.67zM11.71 19c-1.78 0-3.22-1.4-3.22-3.14 0-1.62 1.05-2.76 2.81-3.12 1.77-.36 3.6-1.21 4.62-2.58.39 1.29.59 2.65.59 4.04 0 2.65-2.15 4.8-4.81 4.8z"/>
70 </svg>
71 </span>
72 <span class="custom-label">
73 Trending
74 </span>
75 </div>
76</div>
preview
Sizes

Compact, default, large, and hero rating displays. Small ratings fit inline with product names in tables; large and hero ratings work as display elements on product detail pages and landing pages.

rating-sizes
Live
untitled.html
HTML
1<div class="size-demo">
2 <div class="size-row">
3 <span class="stars sm" style="--rating:4" aria-label="4 stars">
4 ★★★★★
5 </span>
6 <span class="size-label">
7 Small (12px)
8 </span>
9 </div>
10 <div class="size-row">
11 <span class="stars md" style="--rating:4" aria-label="4 stars">
12 ★★★★★
13 </span>
14 <span class="size-label">
15 Default (18px)
16 </span>
17 </div>
18 <div class="size-row">
19 <span class="stars lg" style="--rating:4" aria-label="4 stars">
20 ★★★★★
21 </span>
22 <span class="size-label">
23 Large (28px)
24 </span>
25 </div>
26 <div class="size-row">
27 <span class="stars xl" style="--rating:4" aria-label="4 stars">
28 ★★★★★
29 </span>
30 <span class="size-label">
31 Hero (40px)
32 </span>
33 </div>
34</div>
preview
With Review Breakdown

Pairing the star rating with a review count, average score, and rating distribution bar chart gives users full context. Common in product detail pages, app store listings, and marketplace reviews.

review-breakdown
Live
untitled.html
HTML
1<div class="review-demo">
2 <div class="review-card">
3 <div class="review-header">
4 <span class="review-score">
5 4.7
6 </span>
7 <div class="review-meta">
8 <span class="stars" style="--rating:4.7" aria-label="4.7 stars">
9 ★★★★★
10 </span>
11 <span class="review-count">
12 2,847 reviews
13 </span>
14 </div>
15 </div>
16 <div class="rating-bars">
17 <div class="bar-row">
18 <span class="bar-label">
19 5
20 </span>
21 <div class="bar-track">
22 <div class="bar-fill" style="width:68%">
23 </div>
24 </div>
25 <span class="bar-count">
26 1,936
27 </span>
28 </div>
29 <div class="bar-row">
30 <span class="bar-label">
31 4
32 </span>
33 <div class="bar-track">
34 <div class="bar-fill" style="width:20%">
35 </div>
36 </div>
37 <span class="bar-count">
38 569
39 </span>
40 </div>
41 <div class="bar-row">
42 <span class="bar-label">
43 3
44 </span>
45 <div class="bar-track">
46 <div class="bar-fill" style="width:7%">
47 </div>
48 </div>
49 <span class="bar-count">
50 199
51 </span>
52 </div>
53 <div class="bar-row">
54 <span class="bar-label">
55 2
56 </span>
57 <div class="bar-track">
58 <div class="bar-fill" style="width:3%">
59 </div>
60 </div>
61 <span class="bar-count">
62 85
63 </span>
64 </div>
65 <div class="bar-row">
66 <span class="bar-label">
67 1
68 </span>
69 <div class="bar-track">
70 <div class="bar-fill" style="width:2%">
71 </div>
72 </div>
73 <span class="bar-count">
74 58
75 </span>
76 </div>
77 </div>
78 </div>
79</div>
preview
Color Variants

Match the rating to your brand or semantic intent — success green, info blue, warning yellow, danger red, and neutral gray. Each variant keeps the same accessible contrast against the dark background.

color-variants
Live
untitled.html
HTML
1<div class="color-demo">
2 <div class="color-row">
3 <span class="stars success" style="--rating:4" aria-label="4 stars">
4 ★★★★★
5 </span>
6 <span class="color-label">
7 Success
8 </span>
9 </div>
10 <div class="color-row">
11 <span class="stars info" style="--rating:4" aria-label="4 stars">
12 ★★★★★
13 </span>
14 <span class="color-label">
15 Info
16 </span>
17 </div>
18 <div class="color-row">
19 <span class="stars warning" style="--rating:4" aria-label="4 stars">
20 ★★★★★
21 </span>
22 <span class="color-label">
23 Warning
24 </span>
25 </div>
26 <div class="color-row">
27 <span class="stars danger" style="--rating:4" aria-label="4 stars">
28 ★★★★★
29 </span>
30 <span class="color-label">
31 Danger
32 </span>
33 </div>
34 <div class="color-row">
35 <span class="stars neutral" style="--rating:4" aria-label="4 stars">
36 ★★★★★
37 </span>
38 <span class="color-label">
39 Neutral
40 </span>
41 </div>
42</div>
preview
Rounded & Compact Chips

Compact rating chips with a pill shape work well in cards, tables, and list items where horizontal space is limited. They combine the score, star icon, and review count into a single inline element.

rounded-chips
Live
untitled.html
HTML
1<div class="chip-demo">
2 <span class="rating-chip">
3 <svg viewBox="0 0 24 24" width="14" height="14" fill="currentColor">
4 <path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/>
5 </svg>
6 <span>
7 4.8
8 </span>
9 <span class="chip-count">
10 (128)
11 </span>
12 </span>
13 <span class="rating-chip outline">
14 <svg viewBox="0 0 24 24" width="14" height="14" fill="currentColor">
15 <path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/>
16 </svg>
17 <span>
18 3.5
19 </span>
20 </span>
21 <span class="rating-chip badge">
22 <svg viewBox="0 0 24 24" width="12" height="12" fill="currentColor">
23 <path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/>
24 </svg>
25 <span>
26 Top Rated
27 </span>
28 </span>
29</div>
preview
Read-Only vs Interactive

Side-by-side comparison of read-only (display only, no hover effects) and interactive (clickable, hover preview) ratings. Use pointer-events: none on read-only variants to prevent hover and click interactions.

read-only-vs-interactive
Live
untitled.html
HTML
1<div class="compare-demo">
2 <div class="compare-col">
3 <span class="compare-label">
4 Read-Only
5 </span>
6 <span class="stars readonly" style="--rating:3.5" aria-label="3.5 stars">
7 ★★★★★
8 </span>
9 <span class="compare-value">
10 3.5 — Good
11 </span>
12 </div>
13 <div class="compare-divider">
14 </div>
15 <div class="compare-col">
16 <span class="compare-label">
17 Interactive
18 </span>
19 <span class="stars interactive-stars" id="compare-stars" aria-label="Click to rate">
20 <button class="i-star on" data-value="1" aria-label="1 star">
21
22 </button>
23 <button class="i-star on" data-value="2" aria-label="2 stars">
24
25 </button>
26 <button class="i-star on" data-value="3" aria-label="3 stars">
27
28 </button>
29 <button class="i-star hoverable" data-value="4" aria-label="4 stars">
30
31 </button>
32 <button class="i-star hoverable" data-value="5" aria-label="5 stars">
33
34 </button>
35 </span>
36 <span class="compare-value" id="compare-output">
37 Click to rate
38 </span>
39 </div>
40</div>
preview
CSS Gradient Technique

The star rating uses a CSS custom property --rating with a linear gradient and background-clip: text. The gradient fills stars proportionally based on the rating value — no JavaScript needed for read-only display.

star-rating.css
CSS
1.stars {
2 --rating: 0;
3 --star-size: 18px;
4 --star-color: #333;
5 --star-fill: #00FF41;
6
7 font-size: var(--star-size);
8 letter-spacing: 2px;
9 line-height: 1;
10 color: var(--star-color);
11 background: linear-gradient(
12 90deg,
13 var(--star-fill) calc(var(--rating) / 5 * 100%),
14 var(--star-color) calc(var(--rating) / 5 * 100%)
15 );
16 -webkit-background-clip: text;
17 -webkit-text-fill-color: transparent;
18 background-clip: text;
19 display: inline-block;
20}

info

The CSS gradient technique is ideal for read-only ratings. For interactive ratings, use JavaScript to toggle classes and set aria-checkedon each star. Always provide a text fallback (e.g., "4.5 out of 5 stars") for screen readers.

best practice

When using custom SVG icons, ensure the empty state is visible against the background. Use #333 on dark themes and #DDD on light backgrounds. SVG paths scale crisply at any size and do not depend on monospace character widths.
Accessibility

Rating components must communicate value and state to all users, including those using screen readers or keyboard navigation.

  • Always provide aria-label or visible text with the rating for accessibility.
  • Use role="radiogroup" and role="radio" with aria-checked for interactive ratings.
  • Display the numeric score alongside stars — color-blind users may not distinguish filled from empty.
  • For half-star ratings, ensure each half has a distinct click target and hover state.
  • Use pointer-events: none on read-only ratings to prevent hover effects.
  • On mobile, increase touch targets to at least 44×44px per star.
  • Consider showing a review breakdown (bar chart) alongside the average for transparency.
  • Ensure focus indicators are visible when navigating with a keyboard.
Best Practices
  • Keep the rating scale consistent — most products use 1–5 stars.
  • Use the same empty-state color across all rating instances in a view.
  • Debounce or throttle interactive rating submissions to avoid excessive API calls.
  • Persist the submitted rating visually so users know their input was recorded.
  • Avoid using color alone to convey meaning; pair it with labels or numeric scores.
  • Test custom SVG icons at 200% zoom to confirm they remain clear and aligned.

Community

Get help on Slack, Discord or VIP

Stuck on a guide? Join the community and ask.