---
category: Elements
---
# useElementSize
Reactive size of an HTML element. [ResizeObserver MDN](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver)
## Usage
```vue
Height: {{ height }}
Width: {{ width }}
```
## Component Usage
```vue
Width: {{ width }} Height: {{ height }}
```
## Directive Usage
```vue
```
## Type Declarations
```ts
export interface ElementSize {
width: number
height: number
}
/**
* Reactive size of an HTML element.
*
* @see https://vueuse.org/useElementSize
*/
export declare function useElementSize(
target: MaybeComputedElementRef,
initialSize?: ElementSize,
options?: UseResizeObserverOptions,
): {
width: ShallowRef
height: ShallowRef
stop: () => void
}
export type UseElementSizeReturn = ReturnType
```