Stack Trace

Stack trace block that shows an error trace in a monospace pre with a danger tint and scroll for long output. Useful in error pages, logs and debug panels.

src/registry/ui/stack-trace.tsx/r/stack-trace.json

Installation#

bash
npx shadcn@latest add @minidev/stack-trace

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/stack-trace.json

Usage#

tsx
import { StackTrace } from "@/components/ui/stack-trace"

export function Example() {
  return (
    <StackTrace stack={"Error: boom\n    at render (app.tsx:12)\n    at main (index.tsx:4)"} />
  )
}

API reference#

StackTrace props
PropTypeDefault
stack*string-
classNamestring-

* required

Examples#

All Developer tool UI components for React