title | metaTitle | metaDescription | githubUrl |
---|---|---|---|
Pagination |
Angular Bootstrap Pagination |
Angular Bootstrap Pagination is a component used to indicate existence of a series of related content across multiple pages and enables navigation across them |
Contrast Angular Bootstrap Pagination is a component used to indicate existence of a series of related content across multiple pages and enables navigation across them.
We use a large block of connected links for our pagination, making links hard to miss and easily scalable - all while providing large hit areas. Pagination is built with list HTML elements so screen readers can announce the number of available links. We use a wrapping <nav>
element to identify it as a navigation section to screen readers and other assistive technologies.
To use the Contrast Angular Bootstrap Pagination component in your project you need to import PaginationModule
.
import {PaginationModule } from 'cdbangular';
Alongside the CDBPagination
component, we also use the CDBPageItem
, this represents an item in the CDBPagination
component. Next, we imported the CDBPageLink
component, this component acts as a link.
Setting the circle
prop makes our pagination more rounded. Use the size
prop to describe how little or large you want your pagination to be, and the color
prop.
<CDBPagination [circle]=true>
<CDBPagelink>Prev</CDBPagelink>
<CDBPageitem>1</CDBPageitem>
<CDBPageitem>2</CDBPageitem>
<CDBPageitem>3</CDBPageitem>
<CDBPagelink>Next</CDBPagelink>
</CDBPagination>
<CDBPagination [circle]=true size="big" color="success">
<CDBPagelink>Prev</CDBPagelink>
<CDBPageitem>1</CDBPageitem>
<CDBPageitem>2</CDBPageitem>
<CDBPageitem>3</CDBPageitem>
<CDBPagelink>Next</CDBPagelink>
</CDBPagination>
<CDBPagination size="small" color="secondary">
<CDBPagelink>Prev</CDBPagelink>
<CDBPageitem>1</CDBPageitem>
<CDBPageitem>2</CDBPageitem>
<CDBPageitem>3</CDBPageitem>
<CDBPagelink>Next</CDBPagelink>
</CDBPagination>
<CDBPagination color="warning" [sm]=true>
<CDBPagelink>Prev</CDBPagelink>
<CDBPageitem>1</CDBPageitem>
<CDBPageitem>2</CDBPageitem>
<CDBPageitem>3</CDBPageitem>
<CDBPagelink>Next</CDBPagelink>
</CDBPagination>
<CDBPagination color="white" [sm]=true>
<CDBPagelink>Prev</CDBPagelink>
<CDBPageitem>1</CDBPageitem>
<CDBPageitem>2</CDBPageitem>
<CDBPageitem>3</CDBPageitem>
<CDBPagelink>Next</CDBPagelink>
</CDBPagination>
<CDBPagination color="white">
<CDBPagelink>Prev</CDBPagelink>
<CDBPageitem>1</CDBPageitem>
<CDBPageitem>2</CDBPageitem>
<CDBPageitem>3</CDBPageitem>
<CDBPagelink>Next</CDBPagelink>
</CDBPagination>
<CDBPagination color="danger">
<CDBPagelink>Prev</CDBPagelink>
<CDBPageitem>1</CDBPageitem>
<CDBPageitem>2</CDBPageitem>
<CDBPageitem>3</CDBPageitem>
<CDBPagelink>Next</CDBPagelink>
</CDBPagination>
<CDBPagination>
<CDBPagelink>Prev</CDBPagelink>
<CDBPageitem>1</CDBPageitem>
<CDBPageitem>2</CDBPageitem>
<CDBPageitem>3</CDBPageitem>
<CDBPagelink>Next</CDBPagelink>
</CDBPagination>
This section will build on your information about the props you get to use with the Contrast Angular Bootstrap Pagination component. You will find out what these props do, their default values, and how you would use them in your code.
The table below lists other prop options of the CDBPagination
component.
Name | Type | Default | Description | Example |
---|---|---|---|---|
class | String | Adds custom classes | Adds custom classes | class="myClass" |
size | String | Changes size of pagination component. Choose from lg and sm |
size="sm" | |
sm | Boolean | false | Changes the size of pagination component to sm |
sm=true |
circle | Boolean | false | Changes the shape of pagination component to circular | circle=true |
color | String | dark | Changes default pagination buttons color; available values: [white, dark, primary, secondary, success, danger, warning, info] |
color="white" |
The table below lists other prop options of the CDBPageItem
component.
Name | Type | Default | Description | Example |
---|---|---|---|---|
class | String | Adds custom classes | class="myClass" | |
disable | Boolean | false | Disables item from being clicked | disabled=true |
active | Boolean | false | Sets active state of the button | active=true |
The table below lists other prop options of the CDBPageLink
component.
Name | Type | Default | Description | Example |
---|---|---|---|---|
class | String | Adds custom classes | class="myClass" | |
disable | Boolean | false | Disables item from being clicked | disabled=true |
active | Boolean | false | Sets active state of the button | active=true |