is-browser

PreviousNext

A library that checks if the code is running in a browser.

Docs
hookslib

Preview

Loading preview…
registry/lib/is-browser.ts
/**
 * A library that checks if the code is running in a browser.
 */
export const isBrowser = typeof window !== 'undefined'

Installation

npx shadcn@latest add @hooks/is-browser

Usage

import { IsBrowser } from "@/lib/is-browser"
IsBrowser()