moderator-toolbox-nxg-for-reddit / shared/window/Pager

shared/window/Pager

Functions

Pager()

Pager(__namedParameters): Element

Defined in: extension/data/shared/window/Pager.tsx:14

Displays one page at a time from an iterable of sequential content pages, with a button row for navigating between them.

Parameters

__namedParameters
controlPosition

"top" | "bottom" = 'top'

Where the controls are displayed relative to the page content.

emptyContent

ReactNode

Content to display in case the given iterable returns no pages.

lazy?

boolean = true

If true, not all pages will be pulled from the iterable at once. The final page count won’t be known; a “load more” button will be displayed to attempt to load the next page. Good for asynchronous iterators where computing the next page is expensive and not all pages will be needed.

pages

MaybeAsyncIterable<ReactNode>

An iterable of pages to be displayed.

Returns

Element