Screen size context

Description

This is a context for getting the screen size. Use it when your code needs to reference the inner width or height of the screen. It’s optimized with a debounce. Thus, it takes 250ms before the value is updated once the screen size changes.

Remember: in many cases there are CSS-solutions that can be used instead.

Hooks

useScreenSize()

This will return an object with width and height.

@return {
  width: number,
  height: number
}