Snippets Comments

Bootstrap 5 Rating and Review System with Comments

A rating summary with score distribution bars above a single user review with photos and helpful votes.

Bootstrap 5 No jQuery Dec 2019 4.4K views

<section class="wdw-stage">
  <div class="container" style="max-width: 680px">
    <div class="wdw-card p-4 p-md-5 mb-4">
      <div class="row g-4 align-items-center">
        <div class="col-sm-4 text-center">
          <div class="display-3 fw-bolder text-body-emphasis lh-1">4.0</div>
          <div class="mt-2 mb-1"><span class="text-warning d-inline-flex gap-1" role="img" aria-label="Average rating 4.0 out of 5"><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.75" stroke-linejoin="round" aria-hidden="true"><path d="M12 3l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9z"/></svg><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.75" stroke-linejoin="round" aria-hidden="true"><path d="M12 3l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9z"/></svg><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.75" stroke-linejoin="round" aria-hidden="true"><path d="M12 3l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9z"/></svg><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.75" stroke-linejoin="round" aria-hidden="true"><path d="M12 3l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9z"/></svg><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linejoin="round" aria-hidden="true"><path d="M12 3l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9z"/></svg></span></div>
          <span class="visually-hidden">Average rating 4.0 out of 5</span><div class="small wdw-muted">Based on 159 reviews</div>
        </div>
        <div class="col-sm-8 d-grid gap-2"><div class="d-flex align-items-center gap-3 small"><span class="rv-label text-body-emphasis">Excellent</span><div class="progress flex-grow-1" role="progressbar" aria-label="Excellent" aria-valuenow="77" aria-valuemin="0" aria-valuemax="100" style="height:.5rem"><div class="progress-bar bg-warning rounded-pill" style="width:77%"></div></div><span class="rv-count wdw-muted text-end">123</span></div><div class="d-flex align-items-center gap-3 small"><span class="rv-label">Good</span><div class="progress flex-grow-1" role="progressbar" aria-label="Good" aria-valuenow="14" aria-valuemin="0" aria-valuemax="100" style="height:.5rem"><div class="progress-bar bg-warning rounded-pill" style="width:14%"></div></div><span class="rv-count wdw-muted text-end">23</span></div><div class="d-flex align-items-center gap-3 small"><span class="rv-label">Average</span><div class="progress flex-grow-1" role="progressbar" aria-label="Average" aria-valuenow="6" aria-valuemin="0" aria-valuemax="100" style="height:.5rem"><div class="progress-bar bg-warning rounded-pill" style="width:6%"></div></div><span class="rv-count wdw-muted text-end">10</span></div><div class="d-flex align-items-center gap-3 small"><span class="rv-label">Poor</span><div class="progress flex-grow-1" role="progressbar" aria-label="Poor" aria-valuenow="2" aria-valuemin="0" aria-valuemax="100" style="height:.5rem"><div class="progress-bar bg-warning rounded-pill" style="width:2%"></div></div><span class="rv-count wdw-muted text-end">3</span></div><div class="d-flex align-items-center gap-3 small"><span class="rv-label">Terrible</span><div class="progress flex-grow-1" role="progressbar" aria-label="Terrible" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="height:.5rem"><div class="progress-bar bg-warning rounded-pill" style="width:0%"></div></div><span class="rv-count wdw-muted text-end">0</span></div></div>
      </div>
      <div class="d-flex flex-wrap align-items-center justify-content-between gap-3 mt-4 pt-4 border-top">
        <button type="button" class="btn btn-primary rounded-pill px-4">Write a review</button>
        <div class="d-flex align-items-center gap-2"><label class="small wdw-muted" for="rvSort">Sort by</label><select class="form-select form-select-sm rounded-pill w-auto" id="rvSort"><option>Most helpful</option><option>Newest</option><option>Highest rated</option><option>Lowest rated</option></select></div>
      </div>
    </div>
    <article class="wdw-card p-4 p-md-5">
      <div class="d-flex align-items-center gap-3 mb-3">
        <img src="https://i.pravatar.cc/120?img=12" width="56" height="56" class="rounded-circle" alt="Vikram Singh">
        <div class="flex-grow-1">
          <h2 class="h6 mb-1">Vikram Singh <span class="badge rounded-pill bg-success-subtle text-success-emphasis ms-1">Verified</span></h2>
          <div><span class="text-warning d-inline-flex gap-1" role="img" aria-label="Rated 4 out of 5"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.75" stroke-linejoin="round" aria-hidden="true"><path d="M12 3l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9z"/></svg><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.75" stroke-linejoin="round" aria-hidden="true"><path d="M12 3l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9z"/></svg><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.75" stroke-linejoin="round" aria-hidden="true"><path d="M12 3l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9z"/></svg><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.75" stroke-linejoin="round" aria-hidden="true"><path d="M12 3l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9z"/></svg><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linejoin="round" aria-hidden="true"><path d="M12 3l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9z"/></svg></span></div>
        </div>
        <span class="visually-hidden">Rated 4 out of 5</span><time class="small wdw-muted" datetime="2026-09-10">10 Sep</time>
      </div>
      <h3 class="h5 text-primary mb-2">An awesome activity to experience</h3>
      <p class="mb-3">If you really enjoy spending your vacation on water or would like to try something new and exciting for the first time, this is the one. The guides were patient and the views were unreal.</p>
      <div class="d-flex flex-wrap gap-2 mb-4"><img src="https://images.unsplash.com/photo-1464822759023-fed622ff2c3b?w=240&h=240&fit=crop" width="72" height="72" class="rounded-3 object-fit-cover" alt="Photo from the trip 1"><img src="https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=240&h=240&fit=crop" width="72" height="72" class="rounded-3 object-fit-cover" alt="Photo from the trip 2"><img src="https://images.unsplash.com/photo-1519681393784-d120267933ba?w=240&h=240&fit=crop" width="72" height="72" class="rounded-3 object-fit-cover" alt="Photo from the trip 3"></div>
      <div class="d-flex align-items-center gap-2 pt-3 border-top">
        <span class="small wdw-muted me-2">Was this helpful?</span>
        <button type="button" class="btn btn-sm vote-btn rounded-pill vote" data-vote="up" aria-pressed="false"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7 11v9H3v-9zM7 11l4-8a2 2 0 012 2v4h6a2 2 0 012 2.3l-1.2 7A2 2 0 0117.8 20H7"/></svg><span class="vote-n">20</span></button>
        <button type="button" class="btn btn-sm vote-btn rounded-pill vote" data-vote="down" aria-pressed="false"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" style="transform:scaleY(-1)"><path d="M7 11v9H3v-9zM7 11l4-8a2 2 0 012 2v4h6a2 2 0 012 2.3l-1.2 7A2 2 0 0117.8 20H7"/></svg><span class="vote-n">4</span></button>
      </div>
    </article>
  </div>
</section>

Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.