Logo

Pagination

<div class="overflow-auto">
   <b-pagination
     v-model="currentPage"
     :total-rows="rows"
     :per-page="perPage"
     aria-controls="my-table"
   ></b-pagination>

   <p class="mt-3">Current Page: {{ currentPage }}</p>

   <b-table
     id="my-table"
     :items="items"
     :per-page="perPage"
     :current-page="currentPage"
     small
   ></b-table>
 </div>

<b-pagination> is a custom input component that provides a current page number input control. The value should be bound via v-model in your app. Page numbers are indexed from 1. The number of pages is computed from the provided prop values for total-rows and per-page.

Current Page: 1

Id
First Name
Last Name
1FredFlintstone
2WilmaFlintstone
3BarneyRubble

Button content

<div class="overflow-auto">
   <!-- Use text in props -->
   <b-pagination
     v-model="currentPage"
     :total-rows="rows"
     :per-page="perPage"
     first-text="First"
     prev-text="Prev"
     next-text="Next"
     last-text="Last"
   ></b-pagination>

   <!-- Use emojis in props -->
   <b-pagination
     v-model="currentPage"
     :total-rows="rows"
     :per-page="perPage"
     first-text="⏮"
     prev-text="⏪"
     next-text="⏩"
     last-text="⏭"
     class="mt-4"
   ></b-pagination>

   <!-- Use HTML and sub-components in slots -->
   <b-pagination
     v-model="currentPage"
     :total-rows="rows"
     :per-page="perPage"
     class="mt-4"
   >
     <template v-slot:first-text><span class="text-success">First</span></template>
     <template v-slot:prev-text><span class="text-danger">Prev</span></template>
     <template v-slot:next-text><span class="text-warning">Next</span></template>
     <template v-slot:last-text><span class="text-info">Last</span></template>
     <template v-slot:ellipsis-text>
       <b-spinner small type="grow"></b-spinner>
       <b-spinner small type="grow"></b-spinner>
       <b-spinner small type="grow"></b-spinner>
     </template>
     <template v-slot:page="{ page, active }">
       <b v-if="active">{{ page }}</b>
       <i v-else>{{ page }}</i>
     </template>
   </b-pagination>
 </div>

Button size

<div class="overflow-auto">
   <div>
     <h6>Small</h6>
     <b-pagination v-model="currentPage" :total-rows="rows" size="sm"></b-pagination>
   </div>

   <div class="mt-3">
     <h6>Default</h6>
     <b-pagination v-model="currentPage" :total-rows="rows"></b-pagination>
   </div>

   <div class="mt-3">
     <h6>Large</h6>
     <b-pagination v-model="currentPage" :total-rows="rows" size="lg"></b-pagination>
   </div>
 </div>
Small
Default
Large

Alignment

<div class="overflow-auto">
   <div>
     <h6>Left alignment (default)</h6>
     <b-pagination v-model="currentPage" :total-rows="rows"></b-pagination>
   </div>

   <div class="mt-3">
     <h6 class="text-center">Center alignment</h6>
     <b-pagination v-model="currentPage" :total-rows="rows" align="center"></b-pagination>
   </div>

   <div class="mt-3">
     <h6 class="text-right">Right (end) alignment</h6>
     <b-pagination v-model="currentPage" :total-rows="rows" align="right"></b-pagination>
   </div>

   <div class="mt-3">
     <h6 class="text-center">Fill alignment</h6>
     <b-pagination v-model="currentPage" :total-rows="rows" align="fill"></b-pagination>
   </div>
 </div>
Left alignment (default)
Center alignment
Right (end) alignment
Fill alignment