Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Attachment
- Autocomplete
- Avatar
- Badge
- Breadcrumb
- Bubble
- Button
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Checkbox Group
- Collapsible
- Combobox
- Command
- Context Menu
- Date Picker
- Dialog
- Drawer
- Dropdown Menu
- Empty
- Field
- Fieldset
- Form
- Frame
- Group
- Input
- Input Group
- Kbd
- Label
- Menu
- Menubar
- Message
- Meter
- Number Field
- OTP Field
- Pagination
- Popover
- Preview Card
- Progress
- Questionnaire
- Radio Group
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toggle
- Toggle Group
- Toolbar
- Tooltip
Shared
- Artifact
- Audio Player
- Canvas
- Chain of Thought
- Checkpoint
- Code Block
- Commit
- Connection
- Context
- Controls
- Edge
- Environment Variables
- Mic Selector
- Model Selector
- Node
- Node Toolbar
- Open in Chat
- Panel
- Plan
- Prompt Input
- Queue
- Reasoning
- Sandbox
- Schema Display
- Shimmer
- Snippet
- Sources
- Speech Input
- Stack Trace
- Suggestion
- Tool
- Transcription
- Web Preview
Hooks
Resources
Stack Trace
A parsed, collapsible stack trace.
TypeErrorCannot read properties of undefined (reading 'id')
at resolveUser (/app/src/server/user.ts:42:18)
at handler (/app/src/routes/profile.ts:17:22)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at runMiddleware (/app/node_modules/express/lib/router/index.js:280:10)
import {
StackTrace,
StackTraceActions,
StackTraceContent,
StackTraceCopyButton,
StackTraceError,
StackTraceErrorMessage,
StackTraceErrorType,
StackTraceExpandButton,
StackTraceFrames,
StackTraceHeader,
} from "@/registry/default/shared/stack-trace";
const trace = `TypeError: Cannot read properties of undefined (reading 'id')
at resolveUser (/app/src/server/user.ts:42:18)
at handler (/app/src/routes/profile.ts:17:22)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at runMiddleware (/app/node_modules/express/lib/router/index.js:280:10)`;
export default function Particle() {
return (
<div className="w-full max-w-lg">
<StackTrace defaultOpen trace={trace}>
<StackTraceHeader>
<StackTraceError>
<StackTraceErrorType />
<StackTraceErrorMessage />
</StackTraceError>
<StackTraceActions>
<StackTraceCopyButton />
<StackTraceExpandButton />
</StackTraceActions>
</StackTraceHeader>
<StackTraceContent>
<StackTraceFrames />
</StackTraceContent>
</StackTrace>
</div>
);
}
Installation
pnpm dlx shadcn@latest add @frontal-labs/stack-trace
Usage
import {
StackTrace,
StackTraceHeader,
StackTraceError,
StackTraceErrorType,
StackTraceErrorMessage,
StackTraceActions,
StackTraceCopyButton,
StackTraceExpandButton,
} from "@/components/stack-trace";API Reference
| Export | Props |
|---|---|
StackTrace | <div> attributes, plus its own options |
StackTraceHeader | CollapsibleTrigger props |
StackTraceError | <div> attributes |
StackTraceErrorType | <span> attributes |
StackTraceErrorMessage | <span> attributes |
StackTraceActions | <div> attributes |
StackTraceCopyButton | Button props, plus its own options |
StackTraceExpandButton | <div> attributes |
StackTraceContent | CollapsibleContent props, plus its own options |
StackTraceFrames | <div> attributes, plus its own options |
Open the source under Manual above for the exact prop types.
Examples
TypeErrorCannot read properties of undefined (reading 'id')
at resolveUser (/app/src/server/user.ts:42:18)
at handler (/app/src/routes/profile.ts:17:22)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at runMiddleware (/app/node_modules/express/lib/router/index.js:280:10)
import {
StackTrace,
StackTraceContent,
StackTraceError,
StackTraceErrorMessage,
StackTraceErrorType,
StackTraceFrames,
StackTraceHeader,
} from "@/registry/default/shared/stack-trace";
const trace = `TypeError: Cannot read properties of undefined (reading 'id')
at resolveUser (/app/src/server/user.ts:42:18)
at handler (/app/src/routes/profile.ts:17:22)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at runMiddleware (/app/node_modules/express/lib/router/index.js:280:10)`;
export default function Particle() {
return (
<div className="w-full max-w-lg">
<StackTrace defaultOpen trace={trace}>
<StackTraceHeader>
<StackTraceError>
<StackTraceErrorType />
<StackTraceErrorMessage />
</StackTraceError>
</StackTraceHeader>
<StackTraceContent>
<StackTraceFrames showInternalFrames />
</StackTraceContent>
</StackTrace>
</div>
);
}
On This Page