Snippets Email

Bootstrap 5 Email Inbox Message Layout

An email inbox layout with a folder sidebar, label chips and a message view that has a toolbar, sender header, attachments and a reply box.

Bootstrap 5 No jQuery Oct 2020 2.1K views

<section class="wdw-stage">
  <div class="container" style="max-width:1200px">
    <div class="wdw-card mail overflow-hidden">
      <div class="row g-0">
        <aside class="col-lg-2 mail-side p-3 border-end">
          <button type="button" class="btn btn-primary rounded-pill w-100 mb-3"><i class="bi bi-pencil-square"></i> New email</button>
          <nav class="nav nav-pills flex-lg-column flex-row flex-nowrap gap-1 mail-folders overflow-auto pb-1 pb-lg-0" aria-label="Folders">
            <a class="nav-link active d-flex align-items-center gap-2 flex-shrink-0" href="#" aria-current="page"><i class="bi bi-inbox"></i> Inbox <span class="badge rounded-pill ms-lg-auto text-bg-primary">4</span></a>
            <a class="nav-link d-flex align-items-center gap-2 flex-shrink-0" href="#"><i class="bi bi-star"></i> Starred</a>
            <a class="nav-link d-flex align-items-center gap-2 flex-shrink-0" href="#"><i class="bi bi-send"></i> Sent</a>
            <a class="nav-link d-flex align-items-center gap-2 flex-shrink-0" href="#"><i class="bi bi-bookmark"></i> Important</a>
            <a class="nav-link d-flex align-items-center gap-2 flex-shrink-0" href="#"><i class="bi bi-trash3"></i> Trash</a>
          </nav>
          <p class="wdw-eyebrow mt-4 mb-2 d-none d-lg-block">Labels</p>
          <div class="d-none d-lg-flex flex-column gap-2 small">
            <span class="d-flex align-items-center gap-2"><i class="ldot" style="--c:#ef4444"></i>Home</span>
            <span class="d-flex align-items-center gap-2"><i class="ldot" style="--c:#0ea5e9"></i>Job</span>
            <span class="d-flex align-items-center gap-2"><i class="ldot" style="--c:#22c55e"></i>Clients</span>
            <span class="d-flex align-items-center gap-2"><i class="ldot" style="--c:#f59e0b"></i>News</span>
          </div>
        </aside>
        <div class="col-lg-4 border-end mail-list">
          <div class="px-3 py-3 border-bottom d-flex align-items-center">
            <h2 class="h6 mb-0 fw-bold">Inbox</h2><small class="ms-auto text-body-secondary">4 unread</small>
          </div>
          <div class="list-group list-group-flush" id="mailList" role="listbox" aria-label="Messages">
            <button type="button" class="list-group-item list-group-item-action mail-row active" role="option" aria-selected="true" data-from="Lukasz Holeczek" data-email="[email protected]" data-time="Today, 3:47 PM" data-subject="Quarterly planning: draft roadmap and next steps" data-body="Hi team, attached is the first draft of the roadmap for next quarter. Please skim the priorities and flag anything that feels off before Thursday's review." data-img="12">
              <div class="d-flex align-items-center gap-2"><i class="udot"></i><span class="fw-semibold">Lukasz Holeczek</span><small class="ms-auto text-body-secondary">3:47 PM</small></div>
              <div class="small fw-semibold text-truncate">Quarterly planning: draft roadmap</div>
              <div class="small text-body-secondary text-truncate">Hi team, attached is the first draft…</div>
            </button>
            <button type="button" class="list-group-item list-group-item-action mail-row" role="option" aria-selected="false" data-from="Maya Patel" data-email="[email protected]" data-time="Today, 1:12 PM" data-subject="Invoice #2041 is ready for review" data-body="Hello, the invoice for September is ready. Let me know if the line items look right and I will send it over to accounting this afternoon." data-img="47">
              <div class="d-flex align-items-center gap-2"><i class="udot"></i><span class="fw-semibold">Maya Patel</span><small class="ms-auto text-body-secondary">1:12 PM</small></div>
              <div class="small fw-semibold text-truncate">Invoice #2041 is ready for review</div>
              <div class="small text-body-secondary text-truncate">Hello, the invoice for September…</div>
            </button>
            <button type="button" class="list-group-item list-group-item-action mail-row" role="option" aria-selected="false" data-from="Tomas Berg" data-email="[email protected]" data-time="Yesterday" data-subject="New brand assets for the launch page" data-body="Sharing the final logo pack and icon set. Everything is exported as SVG, and the colour guide is inside the readme." data-img="33">
              <div class="d-flex align-items-center gap-2"><i class="udot"></i><span class="fw-semibold">Tomas Berg</span><small class="ms-auto text-body-secondary">Yesterday</small></div>
              <div class="small fw-semibold text-truncate">New brand assets for the launch page</div>
              <div class="small text-body-secondary text-truncate">Sharing the final logo pack and…</div>
            </button>
            <button type="button" class="list-group-item list-group-item-action mail-row read" role="option" aria-selected="false" data-from="Priya Nair" data-email="[email protected]" data-time="Mon" data-subject="Re: Feedback on the homepage draft" data-body="Thanks for the quick turnaround. The layout feels right, and we only have small copy tweaks that I will list in the shared document." data-img="45">
              <div class="d-flex align-items-center gap-2"><i class="udot invisible"></i><span class="fw-semibold">Priya Nair</span><small class="ms-auto text-body-secondary">Mon</small></div>
              <div class="small text-truncate">Re: Feedback on the homepage draft</div>
              <div class="small text-body-secondary text-truncate">Thanks for the quick turnaround…</div>
            </button>
          </div>
        </div>
        <div class="col-lg-6 p-3 p-lg-4 d-flex flex-column">
          <div class="d-flex flex-wrap align-items-center gap-1 mb-3">
            <button type="button" class="btn btn-light tb" id="starBtn" aria-pressed="false" aria-label="Star"><i class="bi bi-star"></i></button>
            <button type="button" class="btn btn-light tb" aria-label="Reply"><i class="bi bi-reply"></i></button>
            <button type="button" class="btn btn-light tb" aria-label="Reply all"><i class="bi bi-reply-all"></i></button>
            <button type="button" class="btn btn-light tb" aria-label="Forward"><i class="bi bi-forward"></i></button>
            <button type="button" class="btn btn-light tb" aria-label="Delete"><i class="bi bi-trash3"></i></button>
            <div class="dropdown ms-auto">
              <button class="btn btn-light rounded-pill dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false"><i class="bi bi-tags"></i> Label</button>
              <ul class="dropdown-menu dropdown-menu-end" id="labelMenu">
                <li><button type="button" class="dropdown-item d-flex align-items-center gap-2" data-label="Home" data-c="#ef4444" aria-pressed="false"><i class="ldot" style="--c:#ef4444"></i>Home<i class="bi bi-check2 ms-auto invisible"></i></button></li>
                <li><button type="button" class="dropdown-item d-flex align-items-center gap-2" data-label="Job" data-c="#0ea5e9" aria-pressed="false"><i class="ldot" style="--c:#0ea5e9"></i>Job<i class="bi bi-check2 ms-auto invisible"></i></button></li>
                <li><button type="button" class="dropdown-item d-flex align-items-center gap-2" data-label="Clients" data-c="#22c55e" aria-pressed="false"><i class="ldot" style="--c:#22c55e"></i>Clients<i class="bi bi-check2 ms-auto invisible"></i></button></li>
                <li><button type="button" class="dropdown-item d-flex align-items-center gap-2" data-label="News" data-c="#f59e0b" aria-pressed="false"><i class="ldot" style="--c:#f59e0b"></i>News<i class="bi bi-check2 ms-auto invisible"></i></button></li>
              </ul>
            </div>
          </div>
          <h2 class="h5 wdw-heading mb-2" id="mSubject">Quarterly planning: draft roadmap and next steps</h2>
          <div class="d-flex flex-wrap gap-2 mb-3" id="mLabels" aria-live="polite"></div>
          <div class="d-flex align-items-center gap-3 py-3 border-top border-bottom">
            <img class="rounded-circle" width="44" height="44" id="mImg" src="https://i.pravatar.cc/88?img=12" alt="">
            <div class="lh-sm">
              <div class="fw-semibold" id="mFrom">Lukasz Holeczek</div>
              <small class="text-body-secondary" id="mEmail">[email protected]</small>
            </div>
            <small class="ms-auto text-body-secondary text-end" id="mTime">Today, 3:47 PM</small>
          </div>
          <div class="py-3 text-body-secondary mail-body"><p class="mb-0" id="mBody">Hi team, attached is the first draft of the roadmap for next quarter. Please skim the priorities and flag anything that feels off before Thursday's review.</p></div>
          <ul class="list-unstyled mb-3 d-flex flex-wrap gap-2">
            <li class="attach d-flex align-items-center gap-2"><i class="bi bi-file-earmark-zip text-primary"></i><span class="fw-semibold small">bootstrap.zip</span><small class="text-body-secondary">2.5 MB</small></li>
            <li class="attach d-flex align-items-center gap-2"><i class="bi bi-file-earmark-text text-primary"></i><span class="fw-semibold small">readme.txt</span><small class="text-body-secondary">7 KB</small></li>
          </ul>
          <form class="mt-auto" id="replyForm">
            <label for="reply" class="visually-hidden">Reply</label>
            <textarea id="reply" class="form-control mb-2" rows="2" placeholder="Click here to reply" style="min-height:0;height:auto"></textarea>
            <div class="d-flex justify-content-end"><button class="btn btn-primary rounded-pill px-4" type="submit"><i class="bi bi-send"></i> Send</button></div>
          </form>
        </div>
      </div>
    </div>
  </div>
</section>

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