Error State
Error state display with retry action
Overview
ErrorState displays a centered error message with a customizable icon and optional retry button. It is used to communicate loading failures, permission errors, network issues, or server problems in dashboards and data views.
Usage
import { ErrorState } from "@leanicon/web-builder-library/saas";
import { WifiOff } from "lucide-react";
<ErrorState
title="Connection failed"
message="Unable to reach the server. Check your connection."
icon={WifiOff}
onRetry={() => fetchData()}
retryLabel="Reconnect"
/>;Variants
Default
Something went wrong
An unexpected error occurred while loading your dashboard data. Please try again.
Dark
Something went wrong
An unexpected error occurred while loading your dashboard data. Please try again.
Network Error
Connection failed
Unable to reach the server. Check your internet connection and try again.
Network Error - Dark
Connection failed
Unable to reach the server. Check your internet connection and try again.
Server Error
Server error
Our servers are experiencing issues. The team has been notified and is working on a fix.
Permission Error (No Retry)
Access denied
You do not have permission to view this resource. Contact your administrator if you believe this is an error.
Without Retry
Data unavailable
This report is temporarily unavailable. It will be accessible again after the scheduled maintenance window ends.
Custom Retry Label
Failed to load chart
The chart data could not be fetched. Please reload and try again.
Props
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
title | string | Something went wrong | No | |
message | string | — | Yes | |
onRetry | (() => void) | — | No | |
retryLabel | string | Try again | No | |
icon | LucideIcon | — | No |