@payfit/unity-components
Version:
53 lines (52 loc) • 2.88 kB
TypeScript
import { RegisteredRouter, ValidateLinkOptions } from '@tanstack/react-router';
import { RawPaginationNextProps } from '../../../../components/pagination/parts/RawPaginationNext.js';
type PaginationNextRouterProps<TRouter extends RegisteredRouter = RegisteredRouter, TOptions = unknown> = Omit<RawPaginationNextProps, 'href' | 'onPress'> & ValidateLinkOptions<TRouter, TOptions>;
export type PaginationNextProps<TRouter extends RegisteredRouter = RegisteredRouter, TOptions = unknown> = PaginationNextRouterProps<TRouter, TOptions>;
/**
* A pagination next button component that integrates with Tanstack Router for seamless navigation.
* Provides type-safe navigation to the next page with support for preloading.
* @param {PaginationNextProps} props - Router-based props including 'to', 'search', and 'isDisabled'
* @example
* ```tsx
* import { PaginationNext } from '@payfit/unity-components/integrations/tanstack-router'
* import { Pagination, PaginationContent, PaginationItem } from '@payfit/unity-components'
*
* function ProductPagination() {
* const search = useSearch({ from: '/products' })
* const currentPage = search.page || 1
* const pageCount = 10
*
* return (
* <Pagination pageCount={pageCount} currentPage={currentPage} onPageChange={handlePageChange}>
* <PaginationContent>
* <PaginationItem>
* <PaginationNext
* to="/products"
* search={{ ...search, page: currentPage + 1 }}
* isDisabled={currentPage === pageCount}
* preload="intent"
* />
* </PaginationItem>
* </PaginationContent>
* </Pagination>
* )
* }
* ```
* @remarks
* - Automatically renders as a disabled button when isDisabled is true
* - Supports type-safe route parameters and search params with Tanstack Router
* - Enables preload="intent" for data loading before navigation
* - Includes tooltip with "Next" label for accessibility
* - Works with Pagination context for keyboard navigation support
* - Renders a right-facing caret icon
* @see {@link PaginationNextProps} for all available props
* @see Source code in {@link https://github.com/PayFit/hr-apps/tree/master/libs/shared/unity/components/src/integrations/tanstack-router/components/pagination GitHub}
* @see Design specs {@link https://www.figma.com/design/poaMyU7abAgL9VRhx4ygyy/Unity-DS-%3E-Components-Library Figma}
* @see Design docs in {@link https://www.payfit.design/ Payfit.design}
* @see Developer docs in {@link https://unity-components.payfit.io/?path=/ unity-components.payfit.io}
*/
declare function PaginationNext<TRouter extends RegisteredRouter = RegisteredRouter, TOptions = unknown>(props: PaginationNextProps<TRouter, TOptions>): import("react/jsx-runtime").JSX.Element;
declare namespace PaginationNext {
var displayName: string;
}
export { PaginationNext };