Material-ui: List + Pagination

Created on 13 Mar 2019  路  2Comments  路  Source: mui-org/material-ui

I need to put a pagination under the List, but material-ui only provide it for use in the Table, which makes me confused. I want to use the pager elsewhere, not just in the table.

question

All 2 comments

Capture d鈥檈虂cran 2019-03-13 a虁 12 03 51

import React from "react";
import List from "@material-ui/core/List";
import ListItem from "@material-ui/core/ListItem";
import ListItemText from "@material-ui/core/ListItemText";
import TablePagination from "@material-ui/core/TablePagination";

function SimpleList(props) {
  return (
    <div>
      <List>
        <ListItem>
          <ListItemText primary="A" />
        </ListItem>
        <ListItem>
          <ListItemText primary="B" />
        </ListItem>
      </List>
      <TablePagination
        component="nav"
        page={0}
        rowsPerPage={10}
        count={100}
        onChangePage={() => {}}
      />
    </div>
  );
}

export default SimpleList;

https://codesandbox.io/s/73mvo4xw5x

This does not work, even in your code sandbox... It displays the pagination at the bottom, yes, but it does not actually reflect the rows of the list.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mb-copart picture mb-copart  路  3Comments

pola88 picture pola88  路  3Comments

ghost picture ghost  路  3Comments

FranBran picture FranBran  路  3Comments

ryanflorence picture ryanflorence  路  3Comments