ElementSize
interfaceSource L6Type contract for ElementSize.
interface ElementSizeMembers
| Name | Type |
|---|---|
width | number |
height | number |
Open-code aq-ui React hook for Use Element Size.
pnpm dlx aq-ui@alpha add use-element-sizeImport the parts you need, then jump to an export for its contract.
"use client"
import { useElementSize } from "@/hooks/use-element-size"Type contract for ElementSize.
interface ElementSize| Name | Type |
|---|---|
width | number |
height | number |
Open-code aq-ui React hook for Use Element Size.
function useElementSize<T extends Element>(target: Target<T>, initialSize: ElementSize = { width: 0, height: 0 }): ElementSizeElementSize| Name | Type | Default |
|---|---|---|
target | Target<T> | — |
initialSize? | ElementSize | { width: 0, height: 0 } |
hook-target, use-resize-observer