Available since v0.1.0

fs-trigger="online"

Stable

Fires when the browser regains connectivity (window.online event). Use to verify reconnection UI and offline-mode recovery paths.

Syntax

<div
  fs-assert="network/reconnect-sync"
  fs-trigger="online"
  fs-assert-visible=".sync-in-progress">
</div>

When to use it

  • Verifying that offline-queued mutations flush on reconnect
  • Reconnect toast or indicator UI
  • Syncing presence, cart state, draft content when the network returns

Example

<div id="app-root"
  fs-assert="network/reconnect-banner"
  fs-trigger="online"
  fs-assert-removed=".offline-banner">
</div>

When the browser comes back online, assert the offline banner is gone.

Pairs well with

Gotchas

  • Browser-reported connectivity is unreliable. The event reflects what the OS/browser thinks, which may differ from actual reachability. Treat online/offline signals as indicators, not ground truth.
  • Fires on window, not your element. The trigger works by attaching a document-level listener; place it on any element.

See also