Primitives / foldkit-primitives/observers

Bounds

const · packages/primitives/src/observers/bounds.ts:24

const Bounds: Mount.MountDefinitionNoArgs<
  'Bounds',
  {
    readonly _tag: 'Measured'
    readonly x: number
    readonly y: number
    readonly width: number
    readonly height: number
  }
>

Element bounds as a Mount: the bounding rect re-measured on ResizeObserver, window scroll, and window resize, starting with the current rect. Without a ResizeObserver the window events still measure — position changes never needed the observer. No window (SSR) emits nothing instead of throwing.

In the guides