View as Markdown

API reference: @salmonui/navigation/pager

PagerTemplateContextinterface

import type { PagerTemplateContext } from '@salmonui/navigation/pager';
interface PagerTemplateContext extends PagerRenderContext {
    readonly defaultPager: ReactElement;
}

renderPager context: the render context plus the built-in pager content.

PagerTemplateContext members (8, 7 inherited)
NameSignatureDescription
defaultPagerreadonly defaultPager: ReactElement;
pageinheritedpage: number;
pageSizeinheritedpageSize: number;
pageCountinheritedpageCount: number | null;

null while the total is unknown (totalCount={null}).

totalCountinheritedtotalCount: number | null;
hasNextPageinheritedhasNextPage: boolean;
goToPageinheritedgoToPage: (page: number) => void;

Goes to a page (clamped) through the same before / after events, source: 'api'.

setPageSizeinheritedsetPageSize: (pageSize: number | "all") => void;

Sets the page size ('all' = the total) through the same events, source: 'api'.