user-event

Simulates the full sequence of real browser events so Testing Library tests behave the way an actual user does.

Library
npm
v14.6.7
2,330 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
77 /100 Good
Development Activity 60
Maintenance 80
Community 68
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
83 /100 Excellent
Architecture 85
Code Quality 90
Innovation 75
Learning Curve 80

user-event is the companion library to @testing-library/dom (and by extension React Testing Library, Vue Testing Library, and the rest of the Testing Library family) for firing events the way a real user would trigger them, rather than the single low-level DOM event that fireEvent dispatches. Clicking a checkbox with user-event doesn’t just fire a click event — it walks through pointer-down, focus, pointer-up, and click, updating the element’s state along the way, the same as clicking it in a browser would.

The library is built around two layers: a stateful setup() session that tracks keyboard modifier and pointer button state across calls (so pressing {Shift>} in one keyboard() call stays held for the next), and a set of convenience methods (click, type, tab, hover, selectOptions, upload, clipboard.paste, and more) built on top of that shared state. Internally it models keyboard and pointer interaction as explicit System state machines fed by a small event-dispatch layer, so every convenience method ultimately resolves to the same primitive event sequence a browser would produce.

What You Get

  • A stateful userEvent.setup() session API that shares keyboard/pointer state across multiple interaction calls in a single test
  • High-level convenience methods — click, dblClick, tripleClick, hover, unhover, tab — for common interactions
  • A keyboard() API with a small DSL ({Shift>}, {Enter}, [KeyA]) for precise key-by-key and modifier-aware typing
  • A low-level pointer() API for scripting multi-step pointer/touch/pen interaction sequences (press, move, release)
  • Clipboard integration (copy, cut, paste) backed by a stubbed clipboard so paste-driven UI logic can be tested
  • Form-focused utilities: type, clear, upload, selectOptions, deselectOptions for exercising inputs, file pickers, and <select> elements

Common Use Cases

  • Typing into a form field character-by-character to trigger the same onChange/onKeyDown handlers a real keystroke would
  • Testing keyboard-only navigation flows (tab() through focusable elements) for accessibility coverage
  • Simulating drag-style or multi-step pointer interactions (press-move-release) for custom UI widgets
  • Verifying clipboard-driven features by scripting copy/paste against a stubbed clipboard
  • Uploading files to an <input type="file"> in tests without touching the real filesystem dialog

Under The Hood

Architecture A setup() call produces a shared Instance object holding config, a System state machine, and the userEventApi method map; every convenience method is wrapped through a level-tracking async wrapper before it dispatches events via a dedicated event layer, so calls made against one session compose consistently. Keyboard and pointer state live as separate System sub-machines that convenience methods, the keyboard DSL, and the pointer API all read and mutate, which is what lets sequential calls on one instance behave like a continuous user session rather than isolated one-off actions.

Tech Stack Written entirely in TypeScript and built with an esbuild-based pipeline (via the shared kcd-scripts toolchain), targeting CJS output. Tests run under Jest with a jsdom environment, configured through the same shared tooling. The package’s only runtime dependency is a peer dependency on @testing-library/dom — everything else in its dependency list is build or test tooling.

Code Quality The test suite mirrors the source tree section-for-section (clipboard, convenience, document, event, keyboard, pointer, setup, system, utility), backed by shared test helpers for rendering fixtures and capturing dispatched events. Path aliases keep test imports pointed at source and helpers directly. Linting runs through a shared flat ESLint config augmented with project-specific custom rules, and CI runs a typecheck pass ahead of the test suite, indicating a strict, enforced quality bar.

API Design The central ergonomic choice is offering both a one-off direct call (userEvent.click(el)) and a stateful session (userEvent.setup() then user.click(el)) from the same method surface, so simple tests stay terse while multi-step interactions can share keyboard/pointer state. A compact keyboard description syntax (holding modifiers, naming specific physical keys) lets a single string argument express what would otherwise require several imperative press/release calls.

Used by 116 apps in this directory

TypeScript
76%
AGPL 3.0

Abby

Developer Tools · Product Management

166

Statically typed feature flags, remote config, and A/B testing with framework-native SDKs for TypeScript teams.

View details
31
Repo Health
70
Technical
64
Dependency
Built with
TypeScript 76%
MDX 18%
Updated 1 years ago
TypeScript
95%
MIT

Actual

Invoicing Finance

29,186

Local-first personal finance with envelope budgeting, end-to-end encryption, and multi-device sync — no subscription required.

View details
93
Repo Health
85
Technical
73
Dependency
Built with
TypeScript 95%
Updated 4 days ago
Python
99%
MIT

Agent Lightning

AI Development

18,515

A Microsoft-built training framework that optimizes AI agents with reinforcement learning, automatic prompt optimization, or supervised fine-tuning — with near-zero code changes to your existing agent, in any framework.

View details
85
Repo Health
68
Technical
69
Dependency
Built with
Python 99%
Updated 4 days ago
Go
59%
Apache 2.0

agent-orchestrator

AI Agents · AI Code Assistants · Developer Tools

12,440

A local desktop workspace that gives every coding task its own agent, Git branch, and worktree, then tracks tasks, pull requests, CI, and reviews for 27 coding agents on one live Kanban board.

View details
86
Repo Health
83
Technical
68
Dependency
Built with
Go 59%
TypeScript 38%
Updated 4 days ago
TypeScript
86%
MIT

Agents Observe

Developer Tools

684

A real-time, fully local observability dashboard for Claude Code and Codex agent sessions — filtering, search, session replay, and token/cost breakdowns via an auto-starting MCP server.

View details
66
Repo Health
67
Technical
77
Dependency
Built with
TypeScript 86%
JavaScript 10%
Updated 4 weeks ago
TypeScript
95%
Apache 2.0

AionUi

AI Agents · Productivity

33,179

Free, open-source Cowork desktop app that unifies Claude Code, Codex, Gemini CLI, and 20+ AI agents into a single platform with multi-agent teams, 24/7 cron automation, and zero-config built-in agent.

View details
85
Repo Health
76
Technical
66
Dependency
Built with
TypeScript 95%
Updated 3 weeks ago
TypeScript
96%
Other

Amplication

AI Code Assistants · Automation · Developer Tools

16,015

Create production-ready backend services with your organization's standards baked in — generating NestJS, Prisma, and GraphQL code that you own and control.

View details
58
Repo Health
84
Technical
60
Dependency
Built with
TypeScript 96%
Updated 3 months ago
Go
61%
Apache 2.0

Apache Answer

Community

15,683

Open-source Q&A platform for communities, help centers, and knowledge bases with AI assistant and plugin extensibility

View details
90
Repo Health
78
Technical
68
Dependency
Built with
Go 61%
TypeScript 36%
Updated 1 weeks ago
TypeScript
68%
Apache 2.0

Appsmith

Automation · Developer Tools · No Code Platforms

40,959

Open-source low-code platform to build admin panels, dashboards, and internal tools connected to any database or API.

View details
93
Repo Health
79
Technical
66
Dependency
Built with
TypeScript 68%
Java 21%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers