UNPKG

@empoleon/solid-measure

Version:
26 lines (22 loc) 641 B
import { JSX } from "solid-js"; import withContentRect, { WithContentRectChildrenProps, } from "./with-content-rect"; export interface MeasureProps { client?: boolean; offset?: boolean; scroll?: boolean; bounds?: boolean; margin?: boolean; children: (props: WithContentRectChildrenProps) => JSX.Element; innerRef?: ((el: Element) => void) | { current?: Element | null }; onResize?: (contentRect: any) => void; } const Measure = withContentRect()<MeasureProps>((props) => props.children({ measure: props.measure, measureRef: props.measureRef, contentRect: props.contentRect, }) ); export default Measure;