Snippets Buttons

Bootstrap 5 Review and Rating Box with Source Filter

A review summary with overall score, review stats, source filter chips, a collapsible write-a-review form and a list of customer reviews.

Bootstrap 5 No jQuery Dec 2019 3.6K views

<section class="wdw-stage">
  <div class="container" style="max-width:860px">
    <div class="wdw-card overflow-hidden" id="reviews">
      <div class="p-4 p-md-5 d-flex flex-wrap align-items-center gap-4 border-bottom">
        <div class="rv-score text-center">
          <div class="display-5 fw-bold lh-1">4.8</div>
          <div class="small opacity-75 mt-1">out of 5</div>
        </div>
        <div class="d-flex gap-4 flex-grow-1 flex-wrap">
          <div><div class="wdw-eyebrow text-body-secondary">All reviews</div><div class="h3 fw-bold mb-0">124</div></div>
          <div><div class="wdw-eyebrow text-body-secondary">Positive</div><div class="h3 fw-bold mb-0 text-success">93%</div></div>
          <div><div class="wdw-eyebrow text-body-secondary">Response rate</div><div class="h3 fw-bold mb-0">98%</div></div>
        </div>
        <button type="button" class="btn btn-primary rounded-pill px-4" data-bs-toggle="collapse" data-bs-target="#rvForm" aria-expanded="false" aria-controls="rvForm">Write a review</button>
      </div>
      <div class="collapse" id="rvForm">
        <form class="p-4 p-md-5 bg-body-tertiary border-bottom" id="rvFormEl">
          <div class="row g-3">
            <div class="col-sm-6"><label for="rvName" class="form-label small fw-semibold">Your name</label><input id="rvName" class="form-control" required placeholder="Jane Doe"></div>
            <div class="col-sm-6"><label for="rvRating" class="form-label small fw-semibold">Rating</label>
              <select id="rvRating" class="form-select"><option value="5">5 - Excellent</option><option value="4">4 - Very good</option><option value="3">3 - Decent</option><option value="2">2 - Poor</option><option value="1">1 - Terrible</option></select></div>
            <div class="col-12"><label for="rvText" class="form-label small fw-semibold">Your review</label><textarea id="rvText" class="form-control" rows="3" required placeholder="Tell others about your experience"></textarea></div>
            <div class="col-12 text-end"><button type="submit" class="btn btn-primary rounded-pill px-4">Submit review</button></div>
          </div>
        </form>
      </div>
      <div class="px-4 px-md-5 py-3 d-flex flex-wrap gap-2 border-bottom" role="group" aria-label="Filter by source">
          <button type="button" class="btn btn-sm rounded-pill rv-chip is-active" data-source="all" aria-pressed="true">All sources <span class="rv-count">124</span></button>
          <button type="button" class="btn btn-sm rounded-pill rv-chip" data-source="google" aria-pressed="false">Google <span class="rv-count">52</span></button>
          <button type="button" class="btn btn-sm rounded-pill rv-chip" data-source="tripadvisor" aria-pressed="false">Tripadvisor <span class="rv-count">31</span></button>
          <button type="button" class="btn btn-sm rounded-pill rv-chip" data-source="facebook" aria-pressed="false">Facebook <span class="rv-count">24</span></button>
          <button type="button" class="btn btn-sm rounded-pill rv-chip" data-source="reddit" aria-pressed="false">Reddit <span class="rv-count">17</span></button>
          
      </div>
      <div class="rv-list">
        <article class="rv-item d-flex gap-3 p-4" data-source="google">
          <img class="rounded-circle flex-shrink-0" src="https://i.pravatar.cc/96?img=47" width="48" height="48" alt="Emily Carter">
          <div class="flex-grow-1">
            <div class="d-flex flex-wrap align-items-center gap-2 mb-1">
              <h3 class="h6 fw-bold mb-0 text-body-emphasis">Emily Carter</h3>
              <span class="badge rounded-pill text-bg-secondary bg-opacity-10 text-body-secondary text-capitalize">via google</span>
              <small class="text-body-secondary ms-sm-auto">30 min ago</small>
            </div>
            <div class="d-flex align-items-center gap-2 mb-2"><span class="d-inline-flex" role="img" aria-label="5 out of 5"><svg class="rv-star" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3 6.1 20.6l1.3-6.6L2.5 9.4l6.6-.8z"/></svg><svg class="rv-star" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3 6.1 20.6l1.3-6.6L2.5 9.4l6.6-.8z"/></svg><svg class="rv-star" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3 6.1 20.6l1.3-6.6L2.5 9.4l6.6-.8z"/></svg><svg class="rv-star" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3 6.1 20.6l1.3-6.6L2.5 9.4l6.6-.8z"/></svg><svg class="rv-star" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3 6.1 20.6l1.3-6.6L2.5 9.4l6.6-.8z"/></svg></span><strong class="small">Excellent</strong></div>
            <p class="mb-0 text-body-secondary">This dive center is incredibly well organized and is at the top of its game. Instructors were patient and the gear was spotless.</p>
          </div>
        </article>
        <article class="rv-item d-flex gap-3 p-4" data-source="tripadvisor">
          <img class="rounded-circle flex-shrink-0" src="https://i.pravatar.cc/96?img=15" width="48" height="48" alt="Jonas Weber">
          <div class="flex-grow-1">
            <div class="d-flex flex-wrap align-items-center gap-2 mb-1">
              <h3 class="h6 fw-bold mb-0 text-body-emphasis">Jonas Weber</h3>
              <span class="badge rounded-pill text-bg-secondary bg-opacity-10 text-body-secondary text-capitalize">via tripadvisor</span>
              <small class="text-body-secondary ms-sm-auto">2 days ago</small>
            </div>
            <div class="d-flex align-items-center gap-2 mb-2"><span class="d-inline-flex" role="img" aria-label="5 out of 5"><svg class="rv-star" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3 6.1 20.6l1.3-6.6L2.5 9.4l6.6-.8z"/></svg><svg class="rv-star" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3 6.1 20.6l1.3-6.6L2.5 9.4l6.6-.8z"/></svg><svg class="rv-star" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3 6.1 20.6l1.3-6.6L2.5 9.4l6.6-.8z"/></svg><svg class="rv-star" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3 6.1 20.6l1.3-6.6L2.5 9.4l6.6-.8z"/></svg><svg class="rv-star" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3 6.1 20.6l1.3-6.6L2.5 9.4l6.6-.8z"/></svg></span><strong class="small">Worth every penny</strong></div>
            <p class="mb-0 text-body-secondary">Booked a two-day open water course. Small groups, great briefings, and we saw a turtle on the first dive.</p>
          </div>
        </article>
        <article class="rv-item d-flex gap-3 p-4" data-source="facebook">
          <img class="rounded-circle flex-shrink-0" src="https://i.pravatar.cc/96?img=45" width="48" height="48" alt="Mia Alvarez">
          <div class="flex-grow-1">
            <div class="d-flex flex-wrap align-items-center gap-2 mb-1">
              <h3 class="h6 fw-bold mb-0 text-body-emphasis">Mia Alvarez</h3>
              <span class="badge rounded-pill text-bg-secondary bg-opacity-10 text-body-secondary text-capitalize">via facebook</span>
              <small class="text-body-secondary ms-sm-auto">1 week ago</small>
            </div>
            <div class="d-flex align-items-center gap-2 mb-2"><span class="d-inline-flex" role="img" aria-label="4 out of 5"><svg class="rv-star" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3 6.1 20.6l1.3-6.6L2.5 9.4l6.6-.8z"/></svg><svg class="rv-star" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3 6.1 20.6l1.3-6.6L2.5 9.4l6.6-.8z"/></svg><svg class="rv-star" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3 6.1 20.6l1.3-6.6L2.5 9.4l6.6-.8z"/></svg><svg class="rv-star" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3 6.1 20.6l1.3-6.6L2.5 9.4l6.6-.8z"/></svg><svg class="rv-star off" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3 6.1 20.6l1.3-6.6L2.5 9.4l6.6-.8z"/></svg></span><strong class="small">Very good</strong></div>
            <p class="mb-0 text-body-secondary">Friendly crew and well-run boat trips. Only downside was the early start, but the reef made up for it.</p>
          </div>
        </article>
        <article class="rv-item d-flex gap-3 p-4" data-source="reddit">
          <img class="rounded-circle flex-shrink-0" src="https://i.pravatar.cc/96?img=13" width="48" height="48" alt="Tom Fischer">
          <div class="flex-grow-1">
            <div class="d-flex flex-wrap align-items-center gap-2 mb-1">
              <h3 class="h6 fw-bold mb-0 text-body-emphasis">Tom Fischer</h3>
              <span class="badge rounded-pill text-bg-secondary bg-opacity-10 text-body-secondary text-capitalize">via reddit</span>
              <small class="text-body-secondary ms-sm-auto">2 weeks ago</small>
            </div>
            <div class="d-flex align-items-center gap-2 mb-2"><span class="d-inline-flex" role="img" aria-label="3 out of 5"><svg class="rv-star" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3 6.1 20.6l1.3-6.6L2.5 9.4l6.6-.8z"/></svg><svg class="rv-star" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3 6.1 20.6l1.3-6.6L2.5 9.4l6.6-.8z"/></svg><svg class="rv-star" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3 6.1 20.6l1.3-6.6L2.5 9.4l6.6-.8z"/></svg><svg class="rv-star off" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3 6.1 20.6l1.3-6.6L2.5 9.4l6.6-.8z"/></svg><svg class="rv-star off" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3 6.1 20.6l1.3-6.6L2.5 9.4l6.6-.8z"/></svg></span><strong class="small">Decent</strong></div>
            <p class="mb-0 text-body-secondary">Good equipment and safety standards. Gets crowded on weekends, so book a weekday if you can.</p>
          </div>
        </article>
        
      </div>
      <p class="text-center text-body-secondary small m-0 p-4 d-none" id="rvEmpty">No reviews for this source yet.</p>
    </div>
  </div>
</section>

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