Error State

React error state panel with an alert role, a title, explanation and an optional Try again button that calls your retry handler. For failed fetches.

src/registry/ui/error-state.tsx/r/error-state.json

Retry

Installation#

bash
npx shadcn@latest add @minidev/error-state

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/error-state.json

Usage#

tsx
import { ErrorState } from "@/components/ui/error-state"

export function Example() {
  return (
    <ErrorState className="max-w-sm" onRetry={()=>{}} />
  )
}

API reference#

ErrorState props
PropTypeDefault
titlestring"Something went wrong"
descriptionstring"Try again in a moment."
onRetry() => void-
classNamestring-

Dependencies#

npm

React only

Built from

Examples#

All alerts, toasts and empty states

Learn more