Primitives / foldkit-primitives/state

stickyHeader

function · packages/primitives/src/state/virtual.ts:434

function stickyHeader(
  sections: ReadonlyArray<{
    readonly key: string
    readonly index: number
  }>,
  startIndex: number,
): string | null

Which section header sticks for a window: the last section starting at or before the first rendered row, or null above the first section. Order independent — the scan takes the maximum, so unsorted input still answers. CSS position: sticky does the sticking; this answers what sticks, for styling and callbacks.