Skip to content
aq-ui
Back to HooksHook

Use Element Rect

Open-code aq-ui React hook for Use Element Rect.

Installation

pnpm dlx aq-ui@alpha add use-element-rect

API reference

Client module

Import the parts you need, then jump to an export for its contract.

View full source

Quick start

"use client"

import { useElementRect } from "@/hooks/use-element-rect"

useElementRect

functionSource L8

Open-code aq-ui React hook for Use Element Rect.

function useElementRect<T extends Element>(target: Target<T>): DOMRectReadOnly | null
Returns
DOMRectReadOnly | null

Parameters

NameType
targetTarget<T>

Registry dependencies

hook-target, use-isomorphic-layout-effect

Files

  • hooks/use-element-rect.ts

Source