5Sponsor

Error Boundary

React error boundary with graceful terminal display

Terminal
error-boundary-demo
No opentui live preview is registered for this example yet.

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
fallbackReactNodeundefined
onError(error: Error, info: { componentStack: string }) => voidundefined
titlestring"Error"