Interface: UseElementSizeOptions
Defined in: use-element-size.ts:12
Options for useElementSize.
Properties
box?
optionalbox?:"content-box"|"border-box"
Defined in: use-element-size.ts:19
Which box to measure.
"content-box"(default): the content area, excluding padding and border."border-box": the content plus padding and border.
defaultSize?
optionaldefaultSize?:ElementSize
Defined in: use-element-size.ts:24
Size reported on the server and until the element has been measured.
Only read on the first render. Defaults to { width: 0, height: 0 }.
onResize?
optionalonResize?: (size,entry) =>void
Defined in: use-element-size.ts:31
Called from the resize observer whenever the measured size changes,
including the first measurement. Receives the new size and the raw
ResizeObserverEntry, for example to read contentRect or the other
boxes. The latest callback is always used.
Parameters
size
entry
ResizeObserverEntry
Returns
void