

Custom hook that observes the size of an element using the [`ResizeObserver API`](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver).

## Usage [#usage]

```tsx
import { useResizeObserver } from "@tilt-legal/cubitt-components/utilities/hooks";

const myRef = useRef(null);
const { width = 0, height = 0 } = useResizeObserver({
  ref: myRef,
  box: 'content-box',
});

<div ref={myRef}>Hello, world!</div>
```

## API [#api]

### Signature [#signature]

```ts
declare function useResizeObserver<T extends HTMLElement = HTMLElement>(options: UseResizeObserverOptions<T>): Size;
```

### Parameters [#parameters]

| Parameter | Type                                | Description                         | Default |
| --------- | ----------------------------------- | ----------------------------------- | ------- |
| `options` | `UseResizeObserverOptions&lt;T&gt;` | The options for the ResizeObserver. | -       |

### Return Value [#return-value]

| Value    | Type   | Description                         |
| -------- | ------ | ----------------------------------- |
| `return` | `Size` | - The size of the observed element. |
