Skip to content
GaudiGaudi Design System home

Search documentation

Search every page, heading and paragraph.

useScreen

Read a reactive snapshot of the browser screen properties.

HooksEnvironment@gaudi/design-system/hooks/environment/use-screenView in StorybookSource

Measures after mount and refreshes on window resize and screen-orientation changes. Returns a plain snapshot instead of the browser's mutable Screen object.

Usage

import { useScreen } from '@gaudi/design-system/hooks';
const screen = useScreen();

Examples

Playground

Storybook

API

1 return value

Accessibility

Use viewport or container size for responsive layout; display size does not describe the space available to your component.

Notes

  • Dimensions are screen CSS pixels and may be reduced or rounded by browser privacy settings. Orientation and angle are null when unavailable.