1.1.0 • Published 6 years ago
react-everafter v1.1.0
react-everafter
Introduction
This package aims to make pagination generation easier to customize.
Installation
npm i react-everafter -S
Components
EverAfter.Paginator
items:Array. Items to be paginated, preferably objects.wrapper:React.Component. Container for items. Should use attributes of objects initems.perPage:Number. Number of items per page.useListElement:Boolean. True if items are to be put inullist items. Value defaults tofalse.activeTabColor:String. CSS background-color value of tabs when active.truncate:Boolean. Value defaults tofalse.maxPageTabs:Number. Maximum number of page tabs to display. Defaults to5.maxPages:Number. Maximum number of pages to render. Defaults tonull.
EverAfter.TablePaginator
Paginated Table. Properties are the same as those of EverAfter.Paginator, except useListElement. Additional properties are listed.
columns:Array. Must contain objects with keysheaderTextanddisplay.headerTextdictates the text in the column header.displayis aFunctionthat takesitemas sole parameter. Dictates how the item is rendered in the column.enumerate:Boolean. Numbers items if set totrue. Defaults tofalse.
Example Usage
import React, { Component } from 'react';
import EverAfter from 'react-everafter';
var items = [{n: 1}, {n: 2}, {n: 3}, {n: 4}, {n: 5}];
class MyItemContainer extends Component {
render() {
return <div>{this.prop.item.n}</div>
}
}
class MyList extends Component {
render() {
return <EverAfter.Paginator items={items} wrapper={MyItemContainer} perPage={2} useListElement={true} />
}
}1.1.0
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago
0.4.4
7 years ago
0.4.3
7 years ago
0.4.2
7 years ago
0.4.1
7 years ago
0.4.0
7 years ago
0.3.1
7 years ago
0.3.0
7 years ago
0.2.0
7 years ago
0.1.4
7 years ago
0.1.3
7 years ago
0.1.2
7 years ago
0.1.1
7 years ago
0.1.0
7 years ago
0.0.4
7 years ago
0.0.3
7 years ago
0.0.2
7 years ago
0.0.1
7 years ago