Offline UI Indicators
What you'll learn: How to visually communicate offline status to users through banners, toasts, and status bars.
The Core Idea
Once you've implemented a connectivity monitor (from the previous lesson), you need to show users when they've lost connection. Offline UI indicators are visual elements that appear when your application detects the user is offline, helping them understand why content isn't loading or why actions are failing.
Think of it like the "No Service" icon on your phone—it doesn't fix the problem, but it prevents confusion by explaining why things aren't working.
Common Indicator Patterns
Banner (Top or Bottom Bar)
A persistent strip across the top or bottom of the screen that remains visible while offline. This works well because it's non-intrusive but always visible.
Toast Notification
A temporary message that appears when connectivity changes. Good for informing users of transitions ("You're now offline" / "Back online"), but disappears after a few seconds.
Status Badge
A small icon or text indicator in the header or navigation bar. Subtle but always present.
Overlay or Modal
A more aggressive approach that partially or fully blocks the UI. Use sparingly—only when being offline truly prevents all functionality.
Design Considerations
- Position wisely: Top bars are more noticeable; bottom bars less intrusive
- Color coding: Use amber/yellow for offline (not red—it's not an error, just a status)
- Clear messaging: "You're offline" beats technical jargon
- Dismissibility: Let users close toasts, but keep persistent indicators visible
- Timing: Show immediately when offline is detected; confirm briefly when back online
Key Takeaway: Offline UI indicators transform invisible connectivity problems into visible, understandable status updates, preventing user frustration and confusion when network requests inevitably fail.