elementalui / elemental

A flexible and beautiful UI framework for React.js
elemental-ui.com
MIT License
4.31k stars 216 forks source link

Create pagination component #9

Closed jossmac closed 9 years ago

grabbou commented 9 years ago

I would just go with a ButtonGroup or Toolbar component (similar to Bootstrap one) so it can actually be used elsewhere pretty easily.

jossmac commented 9 years ago

Hi @grabbou,

We have a ButtonGroup, but it's for combining associated tools. This component will provide support for pagination and will be similar to bootstrap pagination http://getbootstrap.com/components/#pagination.

For ease of use, it will accept the object that Mongoose paginate returns:

pagination: React.PropTypes.shape({
  currentPage: React.PropTypes.number,
  first:       React.PropTypes.number,
  last:        React.PropTypes.number,
  next:        React.PropTypes.bool,
  pages:       React.PropTypes.array,
  previous:    React.PropTypes.bool,
  total:       React.PropTypes.number,
  totalPages:  React.PropTypes.number
})

I'm building this for Keystone, so if you're familiar with Keystone's pagination that should give you a good idea :)

jossmac commented 9 years ago

Resolved by 2aed2fa