
Terminal output is enough for most test runs, but when a suite grows into hundreds of files, a visual dashboard makes it easier to find the one failing test, rerun a single file, and read console output without scrolling. Vitest UI is the optional @vitest/ui package that provides exactly that. This guide covers installing and opening the dashboard, its main panels, how it relates to the HTML reporter used in continuous integration, and the Trace View introduced in Vitest 5 for browser-mode tests.
Installing Vitest UI
Add @vitest/ui as a development dependency with the same package manager you used for vitest. The version should match the installed vitest major; mixing a 4.x UI with a 5.x runner causes errors. No configuration is required for basic use. The package registers a small web application that Vitest serves locally through its own Vite server.
Opening the dashboard
Start Vitest with the --ui flag, for example by running npx vitest --ui or by adding a test:ui script that calls vitest --ui. Vitest prints a local URL and opens it in your default browser. The dashboard shows the run in progress and stays connected: every time a file changes and tests rerun, the tree updates live. The --open flag controls whether the browser launches automatically, and api options let you change the port if the default is taken.
The main panels
Test tree
The left side lists every test file with its suites and individual tests, each marked as passed, failed, skipped or running. A search box filters by file or test name, and status toggles let you show only failures. Clicking a file reruns only that file, which is faster than editing a filter in the terminal.
Report view
Selecting a test opens its result. Failures show the assertion diff with the same colours as the terminal, the error stack with clickable file locations, and any console output the test produced. Vitest 5 also exposes per-test logs through the API, and the UI groups them under the test that printed them.
Module graph
For a selected file, the graph tab visualises which modules it imports, which were inlined and which were externalised. This is a quick way to see why a change in one file reruns a particular test, and to spot an unexpected import that pulls heavy dependencies into a test.
Console and code
A console tab collects output across the run, and a code tab displays the source of the selected test file. In watch mode, edits you make in the editor appear after the next rerun.
Coverage in the UI
When coverage is enabled with the html reporter, the dashboard adds a coverage tab that embeds the generated report. You can browse files, see line and branch percentages, and jump into the annotated source. Enabling coverage slows each run, so most teams turn it on for a dedicated command rather than the default watch session.
The HTML reporter for CI
The UI is interactive and needs a running Vitest process. For pipelines, use the html reporter instead. It writes a static report into the .vitest directory, and in Vitest 5 the singleFile option produces one self-contained index.html that can be uploaded as a build artefact and opened later. The report looks like the dashboard but without live updates. Vitest 5 also moved the html, json and junit outputs, attachments, screenshots and traces under a single .vitest folder, so one gitignore entry covers them all.
Trace View for browser mode
Vitest 5 adds Trace View for tests that run in browser mode. Enable it with the traceView option under the browser config or with the matching CLI flag. Each interaction, assertion and page.mark call is recorded as a DOM snapshot, and the UI replays them step by step with keyboard navigation. Unlike provider-specific trace tools, it works the same with Playwright and WebdriverIO and needs no external viewer. In watch mode the trace updates as the test reruns.
Tips for daily use
Keep the UI open on a second monitor or split screen while editing; the live tree is a good replacement for staring at terminal scrollback. Use the failure-only filter when a refactor breaks many tests at once. Click a single file to rerun it when iterating on one area. Combine --ui with --project to focus on one workspace project in a monorepo. If the browser tab disconnects, restart the watcher; it reconnects on load. After reproducing a failure, select the smallest relevant test or suite and rerun it while you investigate. Once the fix passes in isolation, rerun the full project to catch effects on neighbouring tests.
When the terminal is enough
The UI is a convenience, not a requirement. Small projects, CI pipelines and quick single-run checks are better served by the default or verbose terminal reporter. Reach for the dashboard when the test tree is large, when console output matters, or when you need the module graph to explain a surprising rerun.
Working with projects in the UI
Monorepos that define several projects see each one as a group in the test tree, labelled with the project name. Nested projects introduced in Vitest 5 appear with their combined names, so a unit project inside an app project reads clearly. Filtering by project in the dashboard mirrors the -p flag on the command line, and failures keep their project label in the report view so you know which environment produced them.
Debugging from the dashboard
Stack traces in the report view link to file locations. Combined with an editor integration, clicking a frame opens the file at the right line. For deeper inspection, start Vitest with the inspect flag and attach your editor's debugger; the UI keeps working alongside it and shows which test is currently paused.
Conclusion
Vitest UI turns a test run into a browsable dashboard with a live test tree, detailed failure views, console output, a module graph and embedded coverage. It installs as one dev dependency and opens with a single flag. For CI, the html reporter and its single-file option provide a static equivalent, and Vitest 5's Trace View extends the same idea to browser-mode tests with step-by-step DOM replay. Together they give you a clear picture of what the suite did and why, without leaving the browser.

