Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
V

v-offline

> 前端框架
Open source

Vue 3 component and composable for detecting online and offline network status with reactive state and customizable polling.

380 stars0 likes2 views
WebsiteGitHub

About

Vue 3 component and composable for detecting online and offline network status with reactive state and customizable polling.

V-Offline ⚡️

⚠️ Docs are for Vue 3, for Vue 2 docs, click here

Features

  • Detect offline & online events for your vue app.
  • Built from scratch usign Vue 2 & Composition API with TypeScript
  • For Vue >3.x version – pnpm add v-offline@latest
  • For Vue >=2.7 version – pnpm add v-offline@legacy
  • For Vue { nuxtApp.vueApp.component('VOffline', VOffline); });
bash

then import the file in `nuxt.config.{j|t}s`:

```js
export default {
  // ...
  plugins: [
    // ...
    { src: '~/plugins/v-offline', mode: 'client' },
    // ...
  ],
  // ...
};

Example

xml

  
    
      

    
    
      

    
  
  
  

API

Props

Name Type Required? Default Description
online-class String No '' Styling the div which you want to give if you're online.
offline-class String No '' Styling the div which you want to give if you're offline.
ping-url String No https://google.com Pinging any url to double check if you're online or not.

Events

Name Returns Description
@detected-condition String Emits a boolean value

Contributing

  1. Fork it ( https://github.com/vinayakkulkarni/v-offline/fork )
  2. Create your feature branch (git checkout -b feat/new-feature)
  3. Commit your changes (git commit -Sam 'feat: add feature')
  4. Push to the branch (git push origin feat/new-feature)
  5. Create a new Pull Request

Note:

  1. Please contribute using GitHub Flow
  2. Commits & PRs will be allowed only if the commit messages & PR titles follow the conventional commit standard, read more about it here
  3. PS. Ensure your commits are signed. Read why

Author

v-offline © Vinayak, Released under the MIT License.

Authored and maintained by Vinayak Kulkarni with help from contributors (list).

vinayakkulkarni.dev · GitHub @vinayakkulkarni · Twitter @_vinayak_k

License

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptawesome-vuedetection-networknetworkoffline

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架