---
category: Elements
---
# useElementBounding
Reactive [bounding box](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect) of an HTML element
## Usage
```vue
```
## Component Usage
```vue
Width: {{ width }} Height: {{ height }}
```
## Directive Usage
```vue
```
## Type Declarations
```ts
export interface UseElementBoundingOptions {
/**
* Reset values to 0 on component unmounted
*
* @default true
*/
reset?: boolean
/**
* Listen to window resize event
*
* @default true
*/
windowResize?: boolean
/**
* Listen to window scroll event
*
* @default true
*/
windowScroll?: boolean
/**
* Immediately call update on component mounted
*
* @default true
*/
immediate?: boolean
/**
* Timing to recalculate the bounding box
*
* Setting to `next-frame` can be useful when using this together with something like {@link useBreakpoints}
* and therefore the layout (which influences the bounding box of the observed element) is not updated on the current tick.
*
* @default 'sync'
*/
updateTiming?: "sync" | "next-frame"
}
/**
* Reactive bounding box of an HTML element.
*
* @see https://vueuse.org/useElementBounding
* @param target
*/
export declare function useElementBounding(
target: MaybeComputedElementRef,
options?: UseElementBoundingOptions,
): {
height: ShallowRef
bottom: ShallowRef
left: ShallowRef
right: ShallowRef
top: ShallowRef
width: ShallowRef
x: ShallowRef
y: ShallowRef
update: () => void
}
export type UseElementBoundingReturn = ReturnType
```