Primitives / foldkit-primitives/state

Viewport

const · packages/primitives/src/state/virtual.ts:360

const Viewport: Mount.MountDefinitionNoArgs<
  'Viewport',
  { readonly _tag: 'ViewportScrolled'; readonly top: number }
>

The scroll container's position, reported on its own scrolls starting with the current one. Attach to the scrolling element; a list that scrolls with the document takes WindowViewport instead.

In the guides