This package includes components relating to pagination in the
Garden Design System.
Installation
npm install @zendeskgarden/react-pagination
npm install react react-dom styled-components @zendeskgarden/react-theming
Usage
import { ThemeProvider } from '@zendeskgarden/react-theming';
import { OffsetPagination } from '@zendeskgarden/react-pagination';
initialState = {
currentPage: 1
};
<ThemeProvider>
<OffsetPagination
totalPages={11}
currentPage={state.currentPage}
onChange={currentPage => setState({ currentPage })}
/>
</ThemeProvider>;
import { ThemeProvider } from '@zendeskgarden/react-theming';
import { CursorPagination } from '@zendeskgarden/react-pagination';
<ThemeProvider>
<CursorPagination aria-label="Cursor pagination">
<CursorPagination.First>First</CursorPagination.First>
<CursorPagination.Previous>Previous</CursorPagination.Previous>
<CursorPagination.Next>Next</CursorPagination.Next>
<CursorPagination.Last>Last</CursorPagination.Last>
</CursorPagination>
</ThemeProvider>;