473
Sponsor

Error Boundary

React error boundary with graceful terminal display

Terminal

Installation

$ pnpm dlx shadcn@latest add @termcn/error-boundary

Usage

import { ErrorBoundary } from "@/components/ui/error-boundary";
<ErrorBoundary title="Application Error">
  <YourAppContent />
</ErrorBoundary>

API Reference

ErrorBoundary

PropTypeDefault
childrenReactNoderequired
fallbackReactNode-
onError(error: Error, info: { componentStack: string }) => void-
titlestring"Error"