# @uiw/react-use-online

> useOnline is a tiny, zero-dependency hook for responding to online/offline changes.

Latest version **1.0.0** (published 2023-08-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install @uiw/react-use-online
pnpm add @uiw/react-use-online
yarn add @uiw/react-use-online
bun add @uiw/react-use-online
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2023-08-04 |
| First published | 2023-08-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 18 |
| Author | Kenny Wong |
| Maintainers | uiwjs, wcjiang |
| Keywords | react-use-online, react.js, react, online, network, hook, hooks, reacthook, uiw, uiw-react, react-component, component, components, ui, framework |

## Links

- npm: https://www.npmjs.com/package/@uiw/react-use-online
- Repository: https://github.com/uiwjs/react-use-online
- Homepage: https://uiwjs.github.io/react-use-online
- Issues: https://github.com/uiwjs/react-use-online/issues
- npm.io page: https://npm.io/package/@uiw/react-use-online

## Alternatives

- [@progress/kendo-ooxml](https://npm.io/package/@progress/kendo-ooxml.md) — 152.1K weekly downloads
- [@progress/kendo-react-ripple](https://npm.io/package/@progress/kendo-react-ripple.md) — 8.0K weekly downloads
- [@progress/kendo-react-orgchart](https://npm.io/package/@progress/kendo-react-orgchart.md) — 4.3K weekly downloads
- [@praxisui/dynamic-fields](https://npm.io/package/@praxisui/dynamic-fields.md) — 2.4K weekly downloads
- [@progress/kendo-vue-listbox](https://npm.io/package/@progress/kendo-vue-listbox.md) — 932 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2023-08-04
- 0.0.1 — 2023-08-04

## README

React useOnline Hook
===

[![Build & Deploy](https://github.com/uiwjs/react-use-online/actions/workflows/ci.yml/badge.svg)](https://github.com/uiwjs/react-use-online/actions/workflows/ci.yml)
[![Coverage Status](https://uiwjs.github.io/react-use-online/badges.svg)](https://uiwjs.github.io/react-use-online/coverage/lcov-report/)
[![NPM Version](https://img.shields.io/npm/v/@uiw/react-use-online.svg)](https://www.npmjs.com/package/@uiw/react-use-online)
[![react@^18](https://shields.io/badge/react-^18-green?style=flat&logo=react)](https://github.com/facebook/react/releases)

`useOnline` is a tiny, zero-dependency, SSR hook for responding to online/offline changes.

## Quick Start

```bash
npm install @uiw/react-use-online
```

## Using

You can use the Chrome Browser Debug Tool(**f11**) to set up **offLine** and **onLine** test hooks.

```jsx mdx:preview
import React from "react";
import { useOnline } from '@uiw/react-use-online';

export default function App() {
  const isOnline = useOnline();
  return (
    <div>
      <h1 style={{ margin: 0 }}>useOnline</h1>
      <div>{isOnline ? '✅ You are online' : '❌ You are offline'}</div>
    </div>
  );
}
```

## Contributors

As always, thanks to our amazing contributors!

<a href="https://github.com/uiwjs/react-use-online/graphs/contributors">
  <img src="https://uiwjs.github.io/react-use-online/CONTRIBUTORS.svg" />
</a>

Made with [contributors](https://github.com/jaywcjlove/github-action-contributors).

## License

Licensed under the MIT License.

---
_Source: https://npm.io/package/@uiw/react-use-online · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
