Pagination
import React from 'react';
import { Pagination, PaginationItem, PaginationLink } from 'reactstrap';
export default class Example extends React.Component {
render() {
return (
<Pagination aria-label="Page navigation example">
<PaginationItem>
<PaginationLink previous href="#" />
</PaginationItem>
<PaginationItem>
<PaginationLink href="#">
1
</PaginationLink>
</PaginationItem>
<PaginationItem>
<PaginationLink href="#">
2
</PaginationLink>
</PaginationItem>
<PaginationItem>
<PaginationLink href="#">
3
</PaginationLink>
</PaginationItem>
<PaginationItem>
<PaginationLink href="#">
4
</PaginationLink>
</PaginationItem>
<PaginationItem>
<PaginationLink href="#">
5
</PaginationLink>
</PaginationItem>
<PaginationItem>
<PaginationLink next href="#" />
</PaginationItem>
</Pagination>
);
}
}
Properties
Pagination.propTypes = {
children: PropTypes.node,
className: PropTypes.string,
listClassName: PropTypes.string,
cssModule: PropTypes.object,
size: PropTypes.string,
tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
listTag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
'aria-label': PropTypes.string
};
PaginationItem.propTypes = {
active: PropTypes.bool,
children: PropTypes.node,
className: PropTypes.string,
cssModule: PropTypes.object,
disabled: PropTypes.bool,
tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
};
PaginationLink.propTypes = {
children: PropTypes.node,
className: PropTypes.string,
cssModule: PropTypes.object,
next: PropTypes.bool,
previous: PropTypes.bool,
tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
'aria-label': PropTypes.string
};
Disabled and active states
import React from 'react';
import { Pagination, PaginationItem, PaginationLink } from 'reactstrap';
export default class Example extends React.Component {
render() {
return (
<Pagination aria-label="Page navigation example">
<PaginationItem disabled>
<PaginationLink previous href="#" />
</PaginationItem>
<PaginationItem active>
<PaginationLink href="#">
1
</PaginationLink>
</PaginationItem>
<PaginationItem>
<PaginationLink href="#">
2
</PaginationLink>
</PaginationItem>
<PaginationItem>
<PaginationLink href="#">
3
</PaginationLink>
</PaginationItem>
<PaginationItem>
<PaginationLink href="#">
4
</PaginationLink>
</PaginationItem>
<PaginationItem>
<PaginationLink href="#">
5
</PaginationLink>
</PaginationItem>
<PaginationItem>
<PaginationLink next href="#" />
</PaginationItem>
</Pagination>
);
}
}
Sizing
import React from 'react';
import { Pagination, PaginationItem, PaginationLink } from 'reactstrap';
export default class Example extends React.Component {
render() {
return (
<Pagination size="lg" aria-label="Page navigation example">
<PaginationItem>
<PaginationLink previous href="#" />
</PaginationItem>
<PaginationItem>
<PaginationLink href="#">
1
</PaginationLink>
</PaginationItem>
<PaginationItem>
<PaginationLink href="#">
2
</PaginationLink>
</PaginationItem>
<PaginationItem>
<PaginationLink href="#">
3
</PaginationLink>
</PaginationItem>
<PaginationItem>
<PaginationLink next href="#" />
</PaginationItem>
</Pagination>
);
}
}
import React from 'react';
import { Pagination, PaginationItem, PaginationLink } from 'reactstrap';
export default class Example extends React.Component {
render() {
return (
<Pagination size="sm" aria-label="Page navigation example">
<PaginationItem>
<PaginationLink previous href="#" />
</PaginationItem>
<PaginationItem>
<PaginationLink href="#">
1
</PaginationLink>
</PaginationItem>
<PaginationItem>
<PaginationLink href="#">
2
</PaginationLink>
</PaginationItem>
<PaginationItem>
<PaginationLink href="#">
3
</PaginationLink>
</PaginationItem>
<PaginationItem>
<PaginationLink next href="#" />
</PaginationItem>
</Pagination>
);
}
}