getBottomOffset: () =>
number
Gets the maximum scroll offset (content height - viewport height).
number
This represents the scroll offset required to view the very bottom of the content. It is clamped to 0 if the content fits entirely within the viewport.
getContentHeight: () =>
number
Gets the total height of the content.
number
The sum of heights of all child items.
getItemHeight: (
index) =>number
Gets the height of a specific item by its index.
number
The index of the child item.
number
The measured height of the item.
getItemPosition: (
index) => {height:number;top:number; } |null
Gets the absolute position and dimensions of a specific item.
number
The index of the child item.
{ height: number; top: number; } | null
Object containing top (offset from content start) and height, or null if the index is invalid.
This method uses a cached offset calculation system (itemOffsetsRef) for performance.
It calculates offsets lazily and caches them until the underlying measurements change.
getViewportHeight: () =>
number
Gets the current height of the visible viewport.
number
The height of the viewport container.
remeasure: () =>
void
Re-measures the ScrollView viewport dimensions.
void
Explicitly triggers a measurement of the viewport Box. This is necessary because Ink does not automatically detect terminal window resizes or parent layout changes that might affect the viewport size.
remeasureItem: (
index) =>void
Triggers re-measurement of a specific child item.
number
The index of the child to re-measure.
void
Forces the MeasurableItem wrapper for the specified index to re-run measureElement.
Use this when a child's content changes internally (e.g., expanding text) without changing props.