useScreen

Read `window.screen` values reactively, with optional initialization and debounce control.

Read window.screen values reactively, with optional initialization and debounce control.

Usage

import { useScreen } from "@tilt-legal/cubitt-components/utilities/hooks";

const screen = useScreen();
const width = screen?.width ?? 0;

API

Signature

declare function useScreen(options: UseScreenOptions<false>): Screen | undefined;
declare function useScreen(options?: Partial<UseScreenOptions<true>>): Screen;

Parameters

This hook takes no arguments.

Return Value

ValueTypeDescription
return`Screenundefined

On this page