Bootstrap 5 Emoji Rating and Review Component
A satisfaction summary with an emoji headline and per-category progress bars, next to an emoji rating form with an optional comment.
<section class="wdw-stage">
<div class="container" style="max-width: 980px;">
<div class="row g-4 align-items-stretch">
<div class="col-lg-6">
<div class="wdw-card p-4 p-md-5 h-100">
<div class="text-center mb-4">
<div class="rv-hero" id="rv-hero" aria-hidden="true">😍</div>
<h1 class="wdw-heading h4 mb-1">3,234 people are satisfied</h1>
<p class="wdw-muted small mb-0">Average across <span id="rv-total">4</span> categories this month</p>
</div>
<ul class="list-unstyled d-grid gap-3 mb-0" id="rv-rows">
<li class="d-flex align-items-center gap-3"><span class="rv-emoji" aria-hidden="true">😍</span><div class="flex-grow-1"><div class="d-flex justify-content-between small mb-1"><span class="fw-semibold">Coffee</span><span class="wdw-muted">200 people</span></div><div class="progress" role="progressbar" aria-label="Coffee satisfaction" aria-valuenow="96" aria-valuemin="0" aria-valuemax="100" style="height:8px"><div class="progress-bar" style="width:96%"></div></div></div></li>
<li class="d-flex align-items-center gap-3"><span class="rv-emoji" aria-hidden="true">😄</span><div class="flex-grow-1"><div class="d-flex justify-content-between small mb-1"><span class="fw-semibold">Customer service</span><span class="wdw-muted">165 people</span></div><div class="progress" role="progressbar" aria-label="Customer service satisfaction" aria-valuenow="82" aria-valuemin="0" aria-valuemax="100" style="height:8px"><div class="progress-bar" style="width:82%"></div></div></div></li>
<li class="d-flex align-items-center gap-3"><span class="rv-emoji" aria-hidden="true">☺️</span><div class="flex-grow-1"><div class="d-flex justify-content-between small mb-1"><span class="fw-semibold">Outdoor lighting</span><span class="wdw-muted">130 people</span></div><div class="progress" role="progressbar" aria-label="Outdoor lighting satisfaction" aria-valuenow="65" aria-valuemin="0" aria-valuemax="100" style="height:8px"><div class="progress-bar" style="width:65%"></div></div></div></li>
<li class="d-flex align-items-center gap-3"><span class="rv-emoji" aria-hidden="true">😥</span><div class="flex-grow-1"><div class="d-flex justify-content-between small mb-1"><span class="fw-semibold">Restrooms</span><span class="wdw-muted">100 people</span></div><div class="progress" role="progressbar" aria-label="Restrooms satisfaction" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="height:8px"><div class="progress-bar bg-warning" style="width:40%"></div></div></div></li>
</ul>
</div>
</div>
<div class="col-lg-6">
<form class="wdw-card p-4 p-md-5 h-100 d-flex flex-column" id="rv-form" novalidate>
<span class="wdw-eyebrow">Your turn</span>
<h2 class="wdw-heading h4 mt-1 mb-1">How was your visit?</h2>
<p class="wdw-muted small mb-4" id="rv-label" aria-live="polite">Pick the face that fits best.</p>
<fieldset class="mb-4">
<legend class="visually-hidden">Rating</legend>
<div class="d-flex justify-content-between gap-1 gap-sm-2" id="rv-faces">
<div class="rv-face"><input type="radio" class="btn-check" name="rv" id="rv1" value="Poor" autocomplete="off"><label for="rv1"><span aria-hidden="true">😡</span><span class="visually-hidden">Poor</span></label></div>
<div class="rv-face"><input type="radio" class="btn-check" name="rv" id="rv2" value="Not great" autocomplete="off"><label for="rv2"><span aria-hidden="true">😕</span><span class="visually-hidden">Not great</span></label></div>
<div class="rv-face"><input type="radio" class="btn-check" name="rv" id="rv3" value="Okay" autocomplete="off"><label for="rv3"><span aria-hidden="true">😐</span><span class="visually-hidden">Okay</span></label></div>
<div class="rv-face"><input type="radio" class="btn-check" name="rv" id="rv4" value="Good" autocomplete="off"><label for="rv4"><span aria-hidden="true">😊</span><span class="visually-hidden">Good</span></label></div>
<div class="rv-face"><input type="radio" class="btn-check" name="rv" id="rv5" value="Loved it" autocomplete="off"><label for="rv5"><span aria-hidden="true">😍</span><span class="visually-hidden">Loved it</span></label></div>
</div>
</fieldset>
<div class="mb-3">
<label for="rv-note" class="form-label small fw-semibold">Anything we should know? <span class="wdw-muted fw-normal">(optional)</span></label>
<textarea class="form-control" id="rv-note" rows="3" placeholder="The coffee was great, the lighting could be warmer..." style="height:auto;min-height:0;"></textarea>
</div>
<button type="submit" class="btn btn-primary rounded-pill mt-auto" id="rv-submit">Send review</button>
</form>
</div>
</div>
</div>
</section>
/* Web Designer Wall library style — shared base for every Bootstrap 5 snippet.
Indigo accent, Plus Jakarta Sans, soft cards, pill buttons. Works in light and dark. */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");
:root,
[data-bs-theme="light"] {
--wdw-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
--bs-body-font-family: var(--wdw-font);
--bs-primary: #4f46e5;
--bs-primary-rgb: 79, 70, 229;
--bs-primary-text-emphasis: #3730a3;
--bs-primary-bg-subtle: #eef2ff;
--bs-primary-border-subtle: #c7d2fe;
--bs-link-color: #4f46e5;
--bs-link-color-rgb: 79, 70, 229;
--bs-link-hover-color: #4338ca;
--bs-link-hover-color-rgb: 67, 56, 202;
--bs-focus-ring-color: rgba(79, 70, 229, 0.25);
--bs-border-radius: 0.75rem;
--bs-border-radius-lg: 1rem;
--bs-border-radius-xl: 1.25rem;
--wdw-radius-card: 1.25rem;
--wdw-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 16px 40px -16px rgba(16, 24, 40, 0.22);
--wdw-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 12px -4px rgba(16, 24, 40, 0.12);
--wdw-stage: #f5f6fb;
}
[data-bs-theme="dark"] {
--bs-primary: #818cf8;
--bs-primary-rgb: 129, 140, 248;
--bs-primary-text-emphasis: #c7d2fe;
--bs-primary-bg-subtle: rgba(129, 140, 248, 0.14);
--bs-primary-border-subtle: rgba(129, 140, 248, 0.35);
--bs-link-color: #a5b4fc;
--bs-link-color-rgb: 165, 180, 252;
--bs-link-hover-color: #c7d2fe;
--bs-link-hover-color-rgb: 199, 210, 254;
--bs-focus-ring-color: rgba(129, 140, 248, 0.35);
--wdw-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -16px rgba(0, 0, 0, 0.7);
--wdw-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 12px -4px rgba(0, 0, 0, 0.5);
--wdw-stage: #0f1117;
}
body { font-family: var(--wdw-font); -webkit-font-smoothing: antialiased; }
/* Bootstrap compiles its blue into these components; point them at the accent. */
.btn-primary {
--bs-btn-bg: var(--bs-primary); --bs-btn-border-color: var(--bs-primary);
--bs-btn-hover-bg: #4338ca; --bs-btn-hover-border-color: #4338ca;
--bs-btn-active-bg: #3730a3; --bs-btn-active-border-color: #3730a3;
--bs-btn-disabled-bg: var(--bs-primary); --bs-btn-disabled-border-color: var(--bs-primary);
--bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}
[data-bs-theme="dark"] .btn-primary { --bs-btn-color: #0f1117; --bs-btn-hover-bg: #a5b4fc; --bs-btn-hover-border-color: #a5b4fc; --bs-btn-hover-color: #0f1117; --bs-btn-active-color: #0f1117; }
.btn-outline-primary {
--bs-btn-color: var(--bs-primary); --bs-btn-border-color: var(--bs-primary);
--bs-btn-hover-bg: var(--bs-primary); --bs-btn-hover-border-color: var(--bs-primary);
--bs-btn-active-bg: var(--bs-primary); --bs-btn-active-border-color: var(--bs-primary);
--bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}
.btn { --bs-btn-font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.btn-sm { min-height: 36px; }
.form-control, .form-select { min-height: 44px; border-radius: .75rem; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: rgba(var(--bs-primary-rgb), .6); box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.form-check-input:checked { background-color: var(--bs-primary); border-color: var(--bs-primary); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--bs-primary); }
.nav { --bs-nav-link-color: var(--bs-secondary-color); --bs-nav-link-hover-color: var(--bs-emphasis-color); }
.pagination { --bs-pagination-active-bg: var(--bs-primary); --bs-pagination-active-border-color: var(--bs-primary); --bs-pagination-color: var(--bs-body-color); --bs-pagination-focus-box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.progress, .progress-stacked { --bs-progress-bar-bg: var(--bs-primary); }
.list-group { --bs-list-group-active-bg: var(--bs-primary); --bs-list-group-active-border-color: var(--bs-primary); }
.dropdown-menu { --bs-dropdown-link-active-bg: var(--bs-primary); border-radius: .875rem; box-shadow: var(--wdw-shadow-sm); }
.accordion { --bs-accordion-active-bg: var(--bs-primary-bg-subtle); --bs-accordion-active-color: var(--bs-primary-text-emphasis); --bs-accordion-btn-focus-box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.badge { font-weight: 600; }
/* Library building blocks — use these instead of re-inventing them per snippet. */
.wdw-stage { min-height: 100vh; display: flex; align-items: center; background: var(--wdw-stage); padding-block: 3rem; }
.wdw-card { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent); border-radius: var(--wdw-radius-card); box-shadow: var(--wdw-shadow); }
.wdw-card-sm { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent); border-radius: 1rem; box-shadow: var(--wdw-shadow-sm); }
.wdw-aurora { position: relative; color: #fff; background: radial-gradient(60% 55% at 100% 0, #818cf8 0, transparent 70%), radial-gradient(65% 60% at 0 100%, #ec4899 0, transparent 65%), #1e1b4b; }
.wdw-eyebrow { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--bs-primary); }
.wdw-heading { font-weight: 800; letter-spacing: -.02em; color: var(--bs-emphasis-color); }
.wdw-muted { color: var(--bs-secondary-color); }
.wdw-icon { width: 2.75rem; height: 2.75rem; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: .875rem; background: var(--bs-primary-bg-subtle); color: var(--bs-primary); }
/* Component */
.rv-hero { font-size: 4.5rem; line-height: 1; margin-bottom: 1rem; display: inline-block; filter: drop-shadow(0 12px 14px rgba(16,24,40,.18)); animation: rv-float 3.5s ease-in-out infinite; }
@keyframes rv-float { 50% { transform: translateY(-6px); } }
.rv-emoji { font-size: 1.75rem; width: 2.75rem; height: 2.75rem; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: .875rem; background: var(--bs-tertiary-bg); }
.rv-face { flex: 1; }
.rv-face label { width: 100%; min-height: 56px; display: flex; align-items: center; justify-content: center; font-size: 1.9rem; border-radius: 1rem; border: 1px solid var(--bs-border-color); background: var(--bs-body-bg); cursor: pointer; filter: grayscale(.55); opacity: .85; transition: transform .15s, filter .15s, opacity .15s, border-color .15s, background .15s; }
.rv-face label:hover { filter: none; opacity: 1; transform: translateY(-2px); }
.rv-face .btn-check:checked + label { filter: none; opacity: 1; transform: translateY(-3px) scale(1.06); border-color: var(--bs-primary); background: var(--bs-primary-bg-subtle); box-shadow: 0 8px 18px -8px rgba(var(--bs-primary-rgb), .7); }
.rv-face .btn-check:focus-visible + label { box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
@media (prefers-reduced-motion: reduce) { .rv-hero { animation: none; } .rv-face label { transition: none; } }
(function () {
function initRatingForm() {
var form = document.getElementById('rv-form');
var label = document.getElementById('rv-label');
var btn = document.getElementById('rv-submit');
if (!form || !label || !btn) return;
var def = label.textContent;
form.addEventListener('change', function (e) {
if (e.target.name === 'rv') label.textContent = 'You picked: ' + e.target.value;
});
form.addEventListener('submit', function (e) {
e.preventDefault();
if (!form.querySelector('input[name="rv"]:checked')) {
label.textContent = 'Please pick a face first.';
return;
}
btn.textContent = 'Thanks for your review!';
btn.disabled = true;
setTimeout(function () {
form.reset(); label.textContent = def; btn.textContent = 'Send review'; btn.disabled = false;
}, 2500);
});
}
initRatingForm();
})();
Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.