3 stack frames
- sendPrompt
- handleSubmit
- Internal frame
Parses JavaScript error frames into function names, file locations and internal-frame labels.
npm install @noorddev/vlak-react
Load the stylesheet once at your app root, then import the components you use.
import "@noorddev/vlak-react/css";
import { StackTrace } from "@noorddev/vlak-react";Per-component imports are available at @noorddev/vlak-react/components/stack-trace.
npx @noorddev/vlak-cli add stack-trace
Adds the component and its dependencies to components/vlak/. Follow the StyleX setup to compile the source in your application.
npx shadcn add https://vlak.dev/r/stack-trace.json
Installs the same source through the shadcn CLI.
import { StackTrace } from "@noorddev/vlak-react";
<StackTrace trace={"TypeError: Draft must contain text\n at sendPrompt (src/composer.tsx:42:5)\n at node:internal/process/task_queues:95:5"} defaultOpen />See the integration example to compose these components with your application's model and data.
Parses V8/Node and Firefox/Safari locations; unknown frame text remains readable.
| Prop | Type | Default | Description |
|---|---|---|---|
tracerequired | string | ||
open | boolean | ||
defaultOpen | boolean | false | |
onOpenChange | (open: boolean) => void | ||
onFilePathClick | (filePath: string, line?: number, column?: number) => void | ||
onCopy | (trace: string) => void | Promise<void> | ||
maxFrames | number |
Also accepts Omit<HTMLAttributes<HTMLElement>, "onCopy">.
The ref reaches HTMLElement.
| Keys | Does |
|---|---|
| Tab | Tab reaches raw-trace copy, the frame disclosure and optional location buttons. |
| Enter, Space | Enter or Space activates copy, toggles the frame summary or requests navigation to a location. |
The same styles are available as CSS. Native HTML provides the static presentation; React or application code supplies state updates and actions.
npm install @noorddev/vlak
import "@noorddev/vlak/css";
<article class="rs-stack-trace" aria-label="TypeError"><header class="rs-stack-trace-header"><div class="rs-stack-trace-heading"><span class="rs-stack-trace-title">TypeError</span><p class="rs-stack-trace-message">Draft must contain text</p></div></header><div class="rs-stack-trace-content"><details class="rs-disclosure" open><summary class="rs-disclosure-summary">1 stack frame</summary><ol class="rs-stack-trace-list"><li class="rs-stack-trace-frame"><span>sendPrompt</span><span>src/composer.tsx:42:5</span></li></ol></details></div></article>