NoA IgniteAccelerator Docs
Contact ↗
GitHubGitHub
  • Get Started
      • Context
      • PaymentEmbed
      • createRenderBlock
      • createRequiredContext
      • createSvgIcon
      • getReactElementRef
      • isRefObject
      • setRef
      • useElementSize
      • useFocusReturn
      • useForkRef
      • useInert
      • useIntersectionObserver
      • useInterval
      • useIsomorphicEffect
      • useMediaQuery
      • useMutationObserver
      • useRTL
      • useResizeObserver
      • useSticky
      • useTimeout
      • useVisualViewport
      • useWindowSize
      • typography
      • AnyFunction
      • Concatenate
      • DistributiveOmit
      • HintedNumber
      • HintedString
      • KeyOfAny
      • MapKeys
      • Maybe
      • OverridableStringUnion
      • Overwrite
      • Prettify
      • PropsFrom
      • Repeat
      • Split
      • WithFallback
      • Writeable
      • assert
      • calculateContrast
      • calculateLuminance
      • capitalize
      • clamp
      • colorContrast
      • deepmerge
      • hexToRGB
      • isObject
      • isPlainObject
      • lerp
      • mapRange
      • normalize
      • omit
      • pick
      • range
      • sleep

On This Page

  • useWindowSize
  • Example
Question? Give us feedback →
@noaignitereact-utilsuseWindowSize

useWindowSize

Tracks window size which updates on window resize.

  • @param options - Configurable options
  • @returns An object containing size information

Example

const { innerWidth, innerHeight } = useWindowSize(ref)
 
if (!innerWidth) return null
return <div>{innerWidth} x {innerHeight}</div>
useVisualViewporttypography

Accelerator Docs