
Description
v-offline is a small Vue component that detects when the browser goes online or offline. It exposes a VOffline component and emits a detected-condition event with a boolean whenever the status changes, so your app can show a message or switch styles. The component takes online-class and offline-class props to style its element in each state, and a ping-url prop, which defaults to https://google.com, to confirm the connection by pinging a URL. It is built with Vue 3 and TypeScript, and a legacy build covers Vue 2.7 and later. You install it with pnpm, then register the component globally in a Vue app or in a Nuxt plugin set to client mode, or bind a reactive ref to the status as the README example shows. The project has a live demo and is published on npm and JSR. It suits front-end developers who want simple network status detection in a Vue or Nuxt app.…
Highlights
- Detects online and offline changes in a Vue app
- Emits a boolean detected-condition event
- Custom classes for online and offline states
- Configurable ping URL to confirm connectivity
- Vue 3 build plus a legacy build for Vue 2.7 and later
Ratings & Reviews
No ratings yet
Be the first to rate v-offline.
People also visit
v-offline FAQ
What does v-offline do?
It tells your Vue app when the network goes up or down, so you can show an offline message or change how the page looks.
How do I install it?
Run pnpm add v-offline@latest for Vue 3, or pnpm add v-offline@legacy for Vue 2.7 and later.
Does it work with Nuxt?
Yes. The README shows a Nuxt plugin that registers the component, and the module config loads that plugin in client mode.
How does it check the connection?
It watches the browser's online status and can ping a URL, which defaults to https://google.com, to double-check that you are online.
What are the best v-offline alternatives?
Popular alternatives to v-offline include vue-simple-calendar, vue-final-modal and vue-word-highlighter. See all v-offline alternatives


















