Pagination

Pagination - 图1

  1. import React from 'react';
  2. import { Pagination, PaginationItem, PaginationLink } from 'reactstrap';
  3. export default class Example extends React.Component {
  4. render() {
  5. return (
  6. <Pagination aria-label="Page navigation example">
  7. <PaginationItem>
  8. <PaginationLink first href="#" />
  9. </PaginationItem>
  10. <PaginationItem>
  11. <PaginationLink previous href="#" />
  12. </PaginationItem>
  13. <PaginationItem>
  14. <PaginationLink href="#">
  15. 1
  16. </PaginationLink>
  17. </PaginationItem>
  18. <PaginationItem>
  19. <PaginationLink href="#">
  20. 2
  21. </PaginationLink>
  22. </PaginationItem>
  23. <PaginationItem>
  24. <PaginationLink href="#">
  25. 3
  26. </PaginationLink>
  27. </PaginationItem>
  28. <PaginationItem>
  29. <PaginationLink href="#">
  30. 4
  31. </PaginationLink>
  32. </PaginationItem>
  33. <PaginationItem>
  34. <PaginationLink href="#">
  35. 5
  36. </PaginationLink>
  37. </PaginationItem>
  38. <PaginationItem>
  39. <PaginationLink next href="#" />
  40. </PaginationItem>
  41. <PaginationItem>
  42. <PaginationLink last href="#" />
  43. </PaginationItem>
  44. </Pagination>
  45. );
  46. }
  47. }

Properties

  1. Pagination.propTypes = {
  2. children: PropTypes.node,
  3. className: PropTypes.string,
  4. listClassName: PropTypes.string,
  5. cssModule: PropTypes.object,
  6. size: PropTypes.string,
  7. tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
  8. listTag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
  9. 'aria-label': PropTypes.string
  10. };
  11. PaginationItem.propTypes = {
  12. active: PropTypes.bool,
  13. children: PropTypes.node,
  14. className: PropTypes.string,
  15. cssModule: PropTypes.object,
  16. disabled: PropTypes.bool,
  17. tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
  18. };
  19. PaginationLink.propTypes = {
  20. children: PropTypes.node,
  21. className: PropTypes.string,
  22. cssModule: PropTypes.object,
  23. next: PropTypes.bool,
  24. previous: PropTypes.bool,
  25. first: PropTypes.bool,
  26. last: PropTypes.bool,
  27. tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
  28. 'aria-label': PropTypes.string
  29. };

Disabled and active states

Pagination - 图2

  1. import React from 'react';
  2. import { Pagination, PaginationItem, PaginationLink } from 'reactstrap';
  3. export default class Example extends React.Component {
  4. render() {
  5. return (
  6. <Pagination aria-label="Page navigation example">
  7. <PaginationItem disabled>
  8. <PaginationLink first href="#" />
  9. </PaginationItem>
  10. <PaginationItem disabled>
  11. <PaginationLink previous href="#" />
  12. </PaginationItem>
  13. <PaginationItem active>
  14. <PaginationLink href="#">
  15. 1
  16. </PaginationLink>
  17. </PaginationItem>
  18. <PaginationItem>
  19. <PaginationLink href="#">
  20. 2
  21. </PaginationLink>
  22. </PaginationItem>
  23. <PaginationItem>
  24. <PaginationLink href="#">
  25. 3
  26. </PaginationLink>
  27. </PaginationItem>
  28. <PaginationItem>
  29. <PaginationLink href="#">
  30. 4
  31. </PaginationLink>
  32. </PaginationItem>
  33. <PaginationItem>
  34. <PaginationLink href="#">
  35. 5
  36. </PaginationLink>
  37. </PaginationItem>
  38. <PaginationItem>
  39. <PaginationLink next href="#" />
  40. </PaginationItem>
  41. <PaginationItem>
  42. <PaginationLink last href="#" />
  43. </PaginationItem>
  44. </Pagination>
  45. );
  46. }
  47. }

Sizing

Pagination - 图3

  1. import React from 'react';
  2. import { Pagination, PaginationItem, PaginationLink } from 'reactstrap';
  3. export default class Example extends React.Component {
  4. render() {
  5. return (
  6. <Pagination size="lg" aria-label="Page navigation example">
  7. <PaginationItem>
  8. <PaginationLink first href="#" />
  9. </PaginationItem>
  10. <PaginationItem>
  11. <PaginationLink previous href="#" />
  12. </PaginationItem>
  13. <PaginationItem>
  14. <PaginationLink href="#">
  15. 1
  16. </PaginationLink>
  17. </PaginationItem>
  18. <PaginationItem>
  19. <PaginationLink href="#">
  20. 2
  21. </PaginationLink>
  22. </PaginationItem>
  23. <PaginationItem>
  24. <PaginationLink href="#">
  25. 3
  26. </PaginationLink>
  27. </PaginationItem>
  28. <PaginationItem>
  29. <PaginationLink next href="#" />
  30. </PaginationItem>
  31. <PaginationItem>
  32. <PaginationLink last href="#" />
  33. </PaginationItem>
  34. </Pagination>
  35. );
  36. }
  37. }

Pagination - 图4

  1. import React from 'react';
  2. import { Pagination, PaginationItem, PaginationLink } from 'reactstrap';
  3. export default class Example extends React.Component {
  4. render() {
  5. return (
  6. <Pagination size="sm" aria-label="Page navigation example">
  7. <PaginationItem>
  8. <PaginationLink first href="#" />
  9. </PaginationItem>
  10. <PaginationItem>
  11. <PaginationLink previous href="#" />
  12. </PaginationItem>
  13. <PaginationItem>
  14. <PaginationLink href="#">
  15. 1
  16. </PaginationLink>
  17. </PaginationItem>
  18. <PaginationItem>
  19. <PaginationLink href="#">
  20. 2
  21. </PaginationLink>
  22. </PaginationItem>
  23. <PaginationItem>
  24. <PaginationLink href="#">
  25. 3
  26. </PaginationLink>
  27. </PaginationItem>
  28. <PaginationItem>
  29. <PaginationLink next href="#" />
  30. </PaginationItem>
  31. <PaginationItem>
  32. <PaginationLink last href="#" />
  33. </PaginationItem>
  34. </Pagination>
  35. );
  36. }
  37. }