Nextjs Core Pagination

-
Pro Component

We’ve created this special component due to the fact that you would have needed to write a lot of code to obtain a small component. So, it was done to make your life easier.


Style

You will find the styles for this component in assets/jss/nextjs-material-dashboard-pro/components/paginationStyle.js.

Example

import React from 'react';

import Paginations from "components/Pagination/Pagination.js";

export default function Example(){
  return (
    <Paginations
      pages={[
        { text: "PREV" },
        { text: 1 },
        { text: 2 },
        { active: true, text: 3 },
        { text: 4 },
        { text: 5 },
        { text: "NEXT" }
      ]}
      color="info"
    />
  );
}

Props

Pagination.defaultProps = {
  color: "primary"
};

Pagination.propTypes = {
  pages: PropTypes.arrayOf(
    PropTypes.shape({
      active: PropTypes.bool,
      disabled: PropTypes.bool,
      text: PropTypes.oneOfType([
        PropTypes.number,
        PropTypes.oneOf(["PREV", "NEXT", "..."])
      ]).isRequired,
      onClick: PropTypes.func
    })
  ).isRequired,
  color: PropTypes.oneOf(["primary", "info", "success", "warning", "danger"])
};