React Layout Utils🔗

@volvo-cars/react-layout-utils

@volvo-cars/react-layout-utils
@volvo-cars/react-layout-utils
@volvo-cars/react-layout-utils

This package exposes useful utility hooks that can be use to help you with layout concerns.

Installation🔗

💡 This package includes Typescript definitions


useElementDimensions🔗

Useful for obtaining static render-time dimensions of a given DOM element. Returns a ref and Dimensions object.

Name
Description
Type
Default Value

useResizeObserver🔗

Useful for obtaining dynamic dimensions of a DOM element, where you need to act upon dimension changes in real time. Returns ref, width, and height.

Name
Description
Type
Default Value

Examples🔗

Demonstration implementations of the hooks can be found in the Storybook.