UNPKG

@react-md/utils

Version:
15 lines 514 B
/** * This is a simple wrapper to get the view width or view height. * * @param direction - Either the "height" or "width" string to get that * dimension * @returns the view width or view height. */ export function getViewportSize(direction) { var de = document.documentElement || { clientHeight: 0, clientWidth: 0 }; if (direction === "width") { return window.innerWidth || de.clientWidth; } return window.innerHeight || de.clientHeight; } //# sourceMappingURL=getViewportSize.js.map