UNPKG

@base-ui-components/react

Version:

Base UI is a library of headless ('unstyled') React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.

13 lines (12 loc) 285 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getMidpoint = getMidpoint; function getMidpoint(element) { const rect = element.getBoundingClientRect(); return { x: (rect.left + rect.right) / 2, y: (rect.top + rect.bottom) / 2 }; }