useElementBounding

reactive bounding box of any element

Demo

Usage

const const textAreaRef: Kaioken.MutableRefObject<HTMLTextAreaElement | null>textAreaRef = useRef<HTMLTextAreaElement | null>(initialValue: HTMLTextAreaElement | null): Kaioken.MutableRefObject<HTMLTextAreaElement | null> (+2 overloads)useRef<HTMLTextAreaElement | null>(null)
const 
const bounding: {
    update: () => void;
    width: number;
    height: number;
    top: number;
    right: number;
    bottom: number;
    left: number;
    x: number;
    y: number;
}
bounding
=
function useElementBounding(ref: Kaioken.MutableRefObject<Element | null>, options?: UseElementBoundingOptions): {
    update: () => void;
    width: number;
    height: number;
    top: number;
    right: number;
    bottom: number;
    left: number;
    x: number;
    y: number;
}
useElementBounding
(const textAreaRef: Kaioken.MutableRefObject<HTMLTextAreaElement | null>textAreaRef)