Bootstrap 5 Feedback Reactions Form with Emoji Rating
A five-step emoji feedback form with an optional comment box and a thank-you confirmation. Choose a face, add a note and send.
<section class="wdw-stage">
<div class="container" style="max-width:520px">
<form class="wdw-card p-4 p-md-5" id="feedback" novalidate>
<div class="text-center mb-4">
<span class="wdw-eyebrow">Feedback</span>
<h2 class="wdw-heading h3 mt-1 mb-2">How was your experience?</h2>
<p class="wdw-muted mb-0">Your answer helps us make the product better.</p>
</div>
<fieldset class="mb-4">
<legend class="visually-hidden">Rate your experience</legend>
<div class="row row-cols-5 g-2 text-center">
<div class="col">
<input class="btn-check" type="radio" name="mood" id="mood-angry" value="Awful" autocomplete="off">
<label class="mood mood-angry" for="mood-angry">
<svg viewBox="0 0 24 24" width="48" height="48" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle class="face" cx="12" cy="12" r="10"/><path d="M7.5 8.5l3 1.2M16.5 8.5l-3 1.2" /><circle cx="9" cy="11.5" r=".6" fill="currentColor"/><circle cx="15" cy="11.5" r=".6" fill="currentColor"/><path d="M8.5 16.5c1-1.2 2.2-1.8 3.5-1.8s2.5.6 3.5 1.8"/></svg>
<span>Awful</span>
</label>
</div>
<div class="col">
<input class="btn-check" type="radio" name="mood" id="mood-sad" value="Bad" autocomplete="off">
<label class="mood mood-sad" for="mood-sad">
<svg viewBox="0 0 24 24" width="48" height="48" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle class="face" cx="12" cy="12" r="10"/><path d="M7.8 10.5q1.2 1 2.4 0M13.8 10.5q1.2 1 2.4 0"/><path d="M8.8 16c1-1 2-1.5 3.2-1.5s2.200.5 3.200 1.500"/></svg>
<span>Bad</span>
</label>
</div>
<div class="col">
<input class="btn-check" type="radio" name="mood" id="mood-ok" value="Okay" autocomplete="off">
<label class="mood mood-ok" for="mood-ok">
<svg viewBox="0 0 24 24" width="48" height="48" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle class="face" cx="12" cy="12" r="10"/><circle cx="9" cy="10.5" r=".7" fill="currentColor"/><circle cx="15" cy="10.5" r=".7" fill="currentColor"/><path d="M9 15.5h6"/></svg>
<span>Okay</span>
</label>
</div>
<div class="col">
<input class="btn-check" type="radio" name="mood" id="mood-good" value="Good" autocomplete="off" checked>
<label class="mood mood-good" for="mood-good">
<svg viewBox="0 0 24 24" width="48" height="48" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle class="face" cx="12" cy="12" r="10"/><circle cx="9" cy="10.5" r=".7" fill="currentColor"/><circle cx="15" cy="10.5" r=".7" fill="currentColor"/><path d="M8.5 14c1 1.400 2.200 2 3.500 2s2.500-.6 3.500-2"/></svg>
<span>Good</span>
</label>
</div>
<div class="col">
<input class="btn-check" type="radio" name="mood" id="mood-happy" value="Amazing" autocomplete="off">
<label class="mood mood-happy" for="mood-happy">
<svg viewBox="0 0 24 24" width="48" height="48" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle class="face" cx="12" cy="12" r="10"/><path d="M7.800 11q1.200-1.800 2.400 0M13.800 11q1.200-1.800 2.400 0"/><path d="M8 13.500h8c0 2.400-1.800 3.800-4 3.800s-4-1.400-4-3.800z" fill="currentColor"/></svg>
<span>Amazing</span>
</label>
</div>
</div>
</fieldset>
<div class="mb-4">
<label class="form-label fw-semibold" for="fb-note">Anything else you'd like to share? <span class="text-body-secondary fw-normal">(optional)</span></label>
<textarea class="form-control" id="fb-note" rows="3" placeholder="Tell us what worked and what didn't"></textarea>
</div>
<button class="btn btn-primary rounded-pill w-100" type="submit">Send feedback</button>
<div class="text-center d-none py-3" id="fb-thanks" role="status">
<div class="wdw-icon mb-3 mx-auto"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12.500l4.500 4.500L19 7.500"/></svg></div>
<h3 class="h5 fw-bold mb-1">Thanks for your feedback</h3>
<p class="wdw-muted mb-3">You rated us <strong class="text-body-emphasis" id="fb-rating"></strong>.</p>
<button class="btn btn-outline-primary rounded-pill px-4" type="button" id="fb-again">Send another</button>
</div>
</form>
</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 */
.mood{display:flex;flex-direction:column;align-items:center;gap:.4rem;padding:.6rem .1rem;border-radius:1rem;cursor:pointer;color:var(--bs-secondary-color);border:1px solid transparent;transition:transform .2s,background .2s,color .2s}
.mood svg{width:100%;max-width:48px;height:auto;transition:transform .25s cubic-bezier(.3,1.6,.5,1)}
.mood .face{fill:var(--bs-tertiary-bg);stroke:var(--bs-border-color);transition:fill .2s,stroke .2s}
.mood span{font-size:.75rem;font-weight:600}
.mood:hover svg{transform:translateY(-3px)}
.btn-check:checked + .mood{background:var(--bs-primary-bg-subtle);border-color:var(--bs-primary-border-subtle);color:var(--bs-emphasis-color)}
.btn-check:checked + .mood svg{transform:scale(1.12)}
.btn-check:checked + .mood .face{fill:#fcd34d;stroke:#d97706}
.btn-check:checked + .mood svg{color:#78350f}
.btn-check:focus-visible + .mood{box-shadow:0 0 0 .25rem var(--bs-focus-ring-color)}
#feedback textarea{height:auto;min-height:0;resize:vertical}
(function () {
function initFeedback() {
var form = document.getElementById('feedback');
if (!form) return;
var thanks = document.getElementById('fb-thanks');
var fields = Array.prototype.slice.call(form.children).filter(function (el) { return el !== thanks; });
function toggle(done) {
fields.forEach(function (el) { el.classList.toggle('d-none', done); });
thanks.classList.toggle('d-none', !done);
}
form.addEventListener('submit', function (e) {
e.preventDefault();
var picked = form.querySelector('input[name="mood"]:checked');
document.getElementById('fb-rating').textContent = picked ? picked.value.toLowerCase() : 'okay';
toggle(true);
});
document.getElementById('fb-again').addEventListener('click', function () {
form.reset();
toggle(false);
});
}
initFeedback();
})();
Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.