CBWIRE
InstallSource CodeIssuesSupport
v2.x
v2.x
  • Introduction
  • Release History
    • What's New With 2.2
    • What's New With 2.1
    • What's New With 2.0
  • Getting Started
  • Examples
  • Essentials
    • Configuration
    • Wires
    • Data Properties
    • Computed Properties
      • Computed Properties ( Proxied )
    • Actions
    • Templates
    • Events & Listeners
    • Wire Lifecycle
    • JavaScript
    • Testing
  • Wire Features
    • Validation
    • File Uploads
    • Query String
    • Redirecting
    • Dependency Injection
  • Template Features
    • Directives
    • Loading States
    • Polling
    • Prefetching
    • Offline State
    • Defer Loading
    • Dirty State
  • Integrations
    • ContentBox CMS
    • Turbo
    • AlpineJS
    • Inline Scripts
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Template Features

Offline State

Toggle UI elements when the user is offline or online. Groovy!

PreviousPrefetchingNextDefer Loading

Last updated 3 years ago

Was this helpful?

You can use wire:offline to display elements when Livewire detects that the user is offline.

<div wire:offline><!-- Oh no, you're offline --></div>

You can also append .class to your wire:offline and specify a CSS class to toggle when the user is offline.

<div wire:offline.class="online" class="online"></div>

Use .remove to specify classes you want to be removed when offline.

<div wire:offline.class.remove="im-online" class="im-online"></div>
Directive