webdevpuneet.com

Bootstrap Session Activity Timeline — Free HTML CSS JS Snippet

Bootstrap Session Activity Timeline · Dashboards · Plain HTML, CSS & JS · Live preview

CategoryDashboards

Copy & paste

Source Code

<div class="container py-5 d-flex justify-content-center">
  <div class="card bssat-card">
    <div class="card-body p-3">
      <h6 class="fw-bold mb-2">Active sessions</h6>
      <ul class="list-unstyled mb-0" id="bssatList"></ul>
    </div>
  </div>
</div>

Extend with AI

Take This Snippet Further With AI

The AI prompt for this one is for Patreon supporters ($3 a month, 7 days free), along with a site with no ads. Supporters enter the passcode once and it is remembered in this browser.

· Become a supporter

What's included

Features

Real account-security fields per row (device, location, last-active time), not generic timeline entries
A "This device" badge clearly distinguishes the session currently being used to view the list
The current session deliberately has no Sign out button, preventing an accidental self-lockout
Signing out of a session removes it immediately, re-rendering from a single updated source array
Icons are chosen per device type for quick visual scanning of a session list

About this UI Snippet

Bootstrap Session Activity Timeline — HTML, CSS & JavaScript

Screenshot of the Bootstrap Session Activity Timeline snippet rendered live

This is a security-data-specific pattern, distinct from a decorative timeline component like bootstrap-timeline-vertical — every row here carries real account-security fields (device, location, last-active time) and a genuine action (revoking a session), not just a chronological list of generic events.

The current: true flag on one session is what drives two related pieces of behavior at once: it adds the green "This device" badge, and it's checked inline (s.current ? '' : '...Sign out button...') to withhold the Sign out button entirely from the current session — a real account-security page shouldn't let a user casually sign out of the very device they're using to view the list, since doing so from inside the app they're currently using would immediately invalidate the session rendering the button they just clicked.

Signing out of another session calls sessions.filter(s => s.id !== ...) and re-renders — in this demo that's purely a local list update, but the shape of it (remove by id, re-render from the updated array) is exactly what wiring up a real revoke-session API call would look like, with the actual network request added right alongside the filter rather than replacing it.

Step by step

How to Use

  1. 1
    Load the snippetFour sessions list, the first (MacBook Pro) marked "This device" with no Sign out button.
  2. 2
    Look at the current device's rowIt has no Sign out action — only other sessions can be revoked from this view.
  3. 3
    Click "Sign out" on the iPhone sessionThat row disappears from the list immediately.
  4. 4
    Sign out of the remaining other sessionsOnly the current device's session remains, with no Sign out button to click at all.

Real-world uses

Common Use Cases

Account security and "manage your devices" settings pages
Pairs with bootstrap-reauthentication-modal for a complete account-security section.
Admin panels showing a user's login history for support purposes
Let support staff see (and in a real app, help revoke) a customer's active sessions.
Post-password-change device review
A natural place to show this list right after a password reset, encouraging users to sign out of unrecognized devices.

Got questions?

Frequently Asked Questions

Because the list is being viewed from that exact session — revoking it would invalidate the page rendering the button mid-click. Signing out of the current device belongs in a dedicated, explicit "Log out" action elsewhere, not mixed into a list meant for reviewing other sessions.

This demo only removes the row from a local array; a real implementation must call an actual backend endpoint to revoke that session's token, and should only remove the row from the UI once that request succeeds.

Yes. Keep the sessions array in component state, mark the current session with the same current flag, and derive the Sign out button's visibility per row from that flag in your render function.

Add a button that filters sessions down to just the entry with current: true, calling your real revoke-session API for every other session id first — the same underlying pattern as the per-row action, applied to the whole list at once.