Shadcn Hooks

useIsOnline

A hook to check if the user is online

Loading...

Installation

npx shadcn@latest add @shadcnhooks/use-is-online

API

/**
 * A hook to check if the network is online
 * @see https://developer.mozilla.org/en-US/docs/Web/API/Window/online_event
 * @returns A boolean indicating if the network is online
 */
export function useIsOnline(): boolean

Last updated on

On this page