@coveo/headless-react
    Preparing search index...

    Interface Pager

    The Pager controller allows to navigate through the different result pages.

    pager.fn.tsx

    interface Pager {
        state: PagerState;
        isCurrentPage(page: number): boolean;
        nextPage(): void;
        previousPage(): void;
        selectPage(page: number): void;
        subscribe(listener: () => void): Unsubscribe;
    }

    Hierarchy (View Summary)

    Index

    Methods

    • Returns true when the current page is equal to the passed page, and false otherwise.

      Parameters

      • page: number

        The page number to check.

      Returns boolean

      Whether the passed page is selected.

    • Updates the results to those on the next page.

      Returns void

    • Updates the results to those on the previous page.

      Returns void

    • Updates the results to those on the passed page.

      Parameters

      • page: number

        The page number.

      Returns void

    • Adds a callback that's invoked on state change.

      Parameters

      • listener: () => void

        A callback that's invoked on state change.

      Returns Unsubscribe

      A function to remove the listener.

    Properties

    state: PagerState

    The state of the Pager controller.