Skip to content
filedom
Esc
↑↓navigate↵open⌘Jpreview
On this page

useBounds

Reads current desktop metrics.

import { useBounds } from 'filedom';

const metrics = useBounds();
if (!metrics?.calibrated) return null;

Parameters

useBounds(
  host?: DesktopHost
)

host: optional host adapter for tests.

Returns

SystemMetrics | null, including width, height, iconSize, and calibrated. The value is null until the host first reports metrics. Once metrics are calibrated, the hook also fills in Finder’s current icon size and grid spacing.

Was this page helpful?