Session List

Session List is a copy-paste React component that stops signed out own device by mistake before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/session-list
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

StopsSigned out own device by mistake

Was this component page useful?

How do I install Session List?

pnpm dlx shadcn@latest add @bollard/session-list

The files land in your project. They're yours to edit.

How do I use Session List in React?

session-list-usage.tsx
import { SessionList, type Session } from "@/components/ui/session-list"

<SessionList sessions={sessions} onRevoke={(id) => remove([id])} onRevokeOthers={remove} />

What input mistakes does Session List catch?

  • Signing out the current device by accident (inline confirm, Cancel focused)
  • "Sign out all others" including this device (it never does)
  • Sessions from a different country than this device
  • Location shown as approximate, not exact

What props does Session List accept?

SessionList props
PropTypeDefault
sessions* (required)

Signed-in sessions; mark the current one with current: true.

Session[]—
onRevoke* (required)

Ends one session. Return a promise to show a pending state; a rejection keeps the row.

(id: string) => void | Promise<void>—
onRevokeOthers

Ends every session except the current one. Defaults to calling `onRevoke` for each.

(ids: string[]) => void | Promise<void>—
locale

Locale for relative times.

string—
title

Templates: `{count}` is filled in.

string"Where you're signed in"
thisDeviceLabel

Badge on the current device.

string"This device"
activeNowLabel

Shown for sessions active right now.

string"Active now"
revokeLabel

Label of each sign-out button.

string"Sign out"
signOutHereLabel

Label of the sign-out button on this device.

string"Sign out here"
revokeOthersLabel

Label of the sign-out-all-others button.

string"Sign out all others ({count})"
currentWarning

Inline warning before signing out this device.

string"This signs you out of this browser now. Anything unsaved…
confirmCurrentLabel

Label of the confirm button for this device.

string"Sign me out"
cancelLabel

Label of the Cancel button.

string"Cancel"
awayText

Flags a session from another country.

string"Different country from this device. Don't recognise it? …
approximateText

Note that locations are approximate.

string"Locations are approximate, based on IP address."
noOthersText

Shown when this is the only session.

string"You're only signed in on this device."
revokedText

Announced after sessions are signed out.

string"Done: {count} signed out."

* required. Also accepts the native props of <section> (className, aria-*, data-*…), passed through to it.

How is Session List accessible?

  • Section labelled by its title; rows set aria-busy while revoking
  • Inline confirm is a labelled group; Cancel gets focus, Escape closes and focus returns
  • Revoke buttons include sr-only device and location
  • Outcome announced in a polite live region

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

This is a UX guard rail. Enforce on the server: Revoke sessions server-side and never trust a client flag for which session is current.

  • Country comparison uses the IP-derived location you pass, which can be wrong (VPNs, mobile carriers)
  • Does not revoke sessions itself; your callbacks do

What expensive mistakes does Session List stop?

Signed out own device by mistake

Also known as

active sessions · devices · logged in devices · sign out everywhere · security settings · where you're logged in · login activity

What dependencies does Session List require?

Session List facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameSession List
Registry identifier@bollard/session-list
Install commandnpx shadcn@latest add @bollard/session-list
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Session List

How does Session List protect destructive mutations?

Session List prevents signed out own device by mistake. Enforces deliberate friction against Signing out the current device by accident (inline confirm, Cancel focused), "Sign out all others" including this device (it never does), Sessions from a different country than this device, Location shown as approximate, not exact. Limitation: authorize session-list mutations on the server.

How do I install session-list with shadcn?

Run `npx shadcn@latest add @bollard/session-list`. Sources added: registry/default/session-list/session-list.tsx. Package requirements: lucide-react.

What props customize Session List?

Session List accepts `sessions`, `onRevoke`, `onRevokeOthers`, `locale`, `title`. Configures active sessions, devices, logged in devices behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of session-list?

Country comparison uses the IP-derived location you pass, which can be wrong (VPNs, mobile carriers). Does not revoke sessions itself; your callbacks do Server requirement: Revoke sessions server-side and never trust a client flag for which session is current.

How does Session List meet accessibility guidelines?

Section labelled by its title; rows set aria-busy while revoking. Inline confirm is a labelled group; Cancel gets focus, Escape closes and focus returns. Revoke buttons include sr-only device and location. Outcome announced in a polite live region. Minimizes errors: sign out all logged me out, logged out current device.

Which components pair with Session List?