Security Event Log

Security Event Log is a copy-paste React component that stops account takeover buried in the activity log 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/security-event-log
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

StopsAccount takeover buried in the activity log

Was this component page useful?

How do I install Security Event Log?

pnpm dlx shadcn@latest add @bollard/security-event-log

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

How do I use Security Event Log in React?

security-event-log-usage.tsx
import { SecurityEventLog, type SecurityEvent } from "@/components/ui/security-event-log"

<SecurityEventLog
  events={events}
  timeZone="Asia/Kolkata"
  now={NOW}
  locale="en-IN"
  limit={6}
  requiredRemedies={["sign_out_all"]}
  onReport={(list, remedies) => new Promise<void>((resolve) => setTimeout(() => { setLog(`Secured: ${list.length} event(s) reported · ${remedies.map((r) => r.key).join(", ")}`); resolve() }, 600))}
  onConfirm={(list) => setLog(`Confirmed ${list.length} event(s)`)}
/>

What input mistakes does Security Event Log catch?

  • Risky changes from devices other than the current one
  • A burst of risky changes within windowMinutes, named as a likely takeover
  • Remedies listed before acting (sign out device, re-enable 2-step, restore recovery)
  • Required remedies that can't be unticked
  • Day grouping in the account's time zone

What props does Security Event Log accept?

SecurityEventLog props
PropTypeDefault
events* (required)

Security events, any order. Entries without an id or a real time are skipped.

SecurityEvent[]—
timeZone

The account's time zone. Days and times follow it, not the browser. Defaults to the device zone after mount.

string—
now

"Now" in epoch ms, for deterministic rendering. Read from the clock every minute when omitted.

number—
locale

Locale for dates and times.

string—
windowMinutes

Risky changes this close together read as one incident.

number60
onReport* (required)

"This wasn't me": secure the account for these events with the steps the user kept ticked. May return a Promise; a rejection shows a retry.

(events: SecurityEvent[], remedies: SecurityRemedy[]) => void | Promise<void>—
requiredRemedies

Remedy keys that are always done and can't be unticked, e.g. ["sign_out_all"].

string[][]
onConfirm

"It was me".

(events: SecurityEvent[]) => void | Promise<void>—
limit

Events shown before "Show older".

number8
messages

Any visible string.

Partial<SecurityEventMessages>—

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

How is Security Event Log accessible?

  • Remedy list is a group labelled by its title; Escape cancels
  • Remedy checkboxes have <label>s; "choose one" note is polite, errors are role=alert
  • Focus moves to the secure button on open and back to the row's report button on cancel
  • Times use <time> with a machine-readable dateTime

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: Run the remedies server-side (revoke sessions, restore factors) and require re-authentication or a recovery check before doing so.

  • Risk and grouping are heuristics over the events you pass
  • Location comes from IP and is approximate
  • Remedies run through your onConfirm; nothing is secured until the server does it

What expensive mistakes does Security Event Log stop?

Account takeover buried in the activity log

Also known as

security activity · login history · recent devices · account takeover · 2fa · recovery email · audit log · this wasn't me

Field type

What dependencies does Security Event Log require?

Security Event Log facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameSecurity Event Log
Registry identifier@bollard/security-event-log
Install commandnpx shadcn@latest add @bollard/security-event-log
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 Security Event Log

What form validation mistake does Security Event Log catch?

Security Event Log prevents account takeover buried in the activity log. Highlights risky account changes from other devices and groups a takeover-shaped burst, with a "This wasn't me" path the user can review. Catches: Risky changes from devices other than the current one, A burst of risky changes within windowMinutes, named as a likely takeover, Remedies listed before acting (sign out device, re-enable 2-step, restore recovery), Required remedies that can't be unticked, Day grouping in the account's time zone. Limitation: validate security-event-log schemas on backend.

How do I install security-event-log with shadcn?

Run `npx shadcn@latest add @bollard/security-event-log`. Sources added: registry/default/security-event-log/events.ts, registry/default/security-event-log/security-event-log.tsx. Package requirements: lucide-react.

What props customize Security Event Log?

Security Event Log accepts `events`, `timeZone`, `now`, `locale`, `windowMinutes`. Configures security activity, login history, recent devices behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of security-event-log?

Risk and grouping are heuristics over the events you pass. Location comes from IP and is approximate. Remedies run through your onConfirm; nothing is secured until the server does it Server requirement: Run the remedies server-side (revoke sessions, restore factors) and require re-authentication or a recovery check before doing so.

How does Security Event Log meet accessibility guidelines?

Remedy list is a group labelled by its title; Escape cancels. Remedy checkboxes have <label>s; "choose one" note is polite, errors are role=alert. Focus moves to the secure button on open and back to the row's report button on cancel. Times use <time> with a machine-readable dateTime. Minimizes errors: account hacked unnoticed, 2fa turned off by attacker.

Which components pair with Security Event Log?