204 Pro components and page blocks

Get Pro

Updated

Stack Trace

New

Preview

Customize

Color
Width460px

Installation

npx shadcn@latest add https://uibrik.com/r/stack-trace.json
Adds the files to components/uibrik/stack-trace and installs @tabler/icons-react and motion. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/stack-trace.

Usage

import { StackTrace } from "@/components/uibrik/stack-trace/stack-trace";​const message = "Cannot read properties of undefined (reading 'amount')";​const frames = [  {    fn: "formatPrice",    file: "src/lib/money.ts",    line: 14,    column: 22,    source: {      start: 10,      lines: [        "export function formatPrice(item: LineItem) {",        "  const currency = item.currency ?? \"USD\";",        "  const fmt = formatter(currency);",        "",        "  return fmt.format(item.price.amount / 100);",        "}",      ],    },  },  {    fn: "CartRow",    file: "src/components/cart/cart-row.tsx",    line: 31,    column: 9,    source: {      start: 28,      lines: ["  return (", "    <li className=\"row\">", "      <span>{item.name}</span>", "      <span>{formatPrice(item)}</span>", "    </li>", "  );"],    },  },  // …6 more];​const events = [3, 2, 4, 2, 1, 2, 3, 5, 4, 6, 8, 12, 9, 7, 14, 22, 31, 26, 18, 12, 9, 11, 7, 5];​<StackTrace  type="TypeError"  message={message}  color="#e5484d"  eventsLabel="24h"  defaultOpen={false}  defaultExpanded={false}  width={460}  frames={frames}  events={events}  users={214}  tags={["Chrome 131", "v2.4.1", "checkout"]}/>

Where to use Stack Trace

  • Error monitoring dashboards

    Each issue reads in one line, and the source is a click away instead of a page away.

    Pairs with Uptime Bar

  • Developer tool landing pages

    An error that unfolds into its stack and source shows what the product does without a screenshot.

    Pairs with Terminal Demo

  • Crash reports in admin panels

    Library frames fold away, so the frames from your own code are the ones people read.

Props

StackTrace
type
Type string
"TypeError"
Error class, shown in the pill.
message
Type string
"Cannot read properties of undefined (reading 'amount')"
The error message.
color
Type string
"#e5484d"
Colour of the error pill, the peak bar and the failing line.
eventsLabel
Type string
"24h"
Span the bars cover.
defaultOpen
Type boolean
false
Show the failing frame's source on mount.
defaultExpanded
Type boolean
false
Show every frame on mount.
width
Type number
460
Width of the card; never wider than its container.
frames
Type { fn: string; file: string; line: number; column?: number; inApp?: boolean; source?: { start: number; lines: string[] } }[]
–
Innermost frame first. Frames with inApp false fold into library rows; frames with source open to show it.
events
Type number[]
–
Events per bucket, oldest first; drawn as the bars in the header.
users
Type number
214
People affected.
tags
Type string[]
–
Short facts in the footer, e.g. browser and release.
className
Type string
–
Classes for the wrapper.