Offline Banner

A full width amber banner shown when the app loses its connection, with a wifi off icon, a note that changes will sync later and an optional Retry button.

src/registry/ui/offline-banner.tsx/r/offline-banner.json
You are offline. Changes will sync when you reconnect.

With retry

Installation#

bash
npx shadcn@latest add @minidev/offline-banner

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/offline-banner.json

Usage#

tsx
import { OfflineBanner } from "@/components/ui/offline-banner"

export function Example() {
  return (
    <OfflineBanner onRetry={() => {}} />
  )
}

API reference#

OfflineBanner props
PropTypeDefault
classNamestring-
onRetry() => void-

Dependencies#

npm

lucide-react

Built from

All alerts, toasts and empty states