Skip to content

Accessibility: Work in progress

Translations: Not Needed

Pagination

This component provides a way to navigate through paginated data with customizable options.

Default

Rows per page

15

1 - 15 of 183

...
Vue
html
<template>
  <HLPagination
    :current-page="currentPage"
    :item-count="183"
    :per-page="currentPerPage"
    :pages-to-display="7"
    per-page-text="Rows per page"
    :per-page-dropdown-options="options"
    @update:page="changePage"
    @update:perPage="changePerPage"
  >
    <template #prev> Previous </template>
    <template #next> Next </template>
  </HLPagination>
</template>
<script setup lang="ts">
  import { HLPagination } from '@platform-ui/highrise'
  import { ref } from 'vue'

  const options = [
    { key: 10, label: '10' },
    { key: 20, label: '20' },
    { key: 50, label: '50' },
    { key: 100, label: '100' },
  ]
  const currentPage = ref(1)
  const currentPerPage = ref(15)
  const changePage = page => {
    currentPage.value = page
  }
  const changePerPage = perPage => {
    currentPerPage.value = perPage
  }
</script>

Collapsed

Rows per page

15

1 - 15 of 183

Page 1 of 13

Vue
html
<template>
  <HLPagination
    :current-page="currentPage"
    :item-count="183"
    :per-page="currentPerPage"
    :pages-to-display="7"
    per-page-text="Rows per page"
    :per-page-dropdown-options="options"
    @update:page="changePage"
    @update:perPage="changePerPage"
    collapsed
    show-current-range
    show-total-pages
  >
    <template #prev> Previous </template>
    <template #next> Next </template>
  </HLPagination>
</template>
<script setup>
  import { HLPagination } from '@platform-ui/highrise'
  import { ref } from 'vue'
  const options = [
    { key: 10, label: '10' },
    { key: 20, label: '20' },
    { key: 50, label: '50' },
    { key: 100, label: '100' },
  ]
  const currentPage = ref(1)
  const currentPerPage = ref(15)
  const changePage = page => {
    currentPage.value = page
  }
  const changePerPage = perPage => {
    currentPerPage.value = perPage
  }
</script>

All Sizes

Small (sm):

Rows per page

15

1 - 15 of 183

...

Page 1 of 13


Medium (md):

Rows per page

15

1 - 15 of 183

...

Page 1 of 13

html
<!-- Small (sm) -->
<HLPagination
  :current-page="currentPage"
  :item-count="183"
  :per-page="currentPerPage"
  :per-page-dropdown-options="options"
  @update:page="changePage"
  @update:perPage="changePerPage"
  size="sm"
  show-current-range
  show-total-pages
>
  <template #prev> Previous </template>
  <template #next> Next </template>
</HLPagination>

<!-- Medium (md) -->
<HLPagination
  :current-page="currentPage"
  :item-count="183"
  :per-page="currentPerPage"
  :per-page-dropdown-options="options"
  @update:page="changePage"
  @update:perPage="changePerPage"
  size="md"
  show-current-range
  show-total-pages
>
  <template #prev> Previous </template>
  <template #next> Next </template>
</HLPagination>
ts
import { HLPagination } from '@platform-ui/highrise'
import { ref } from 'vue'
const options = [
  { key: 10, label: '10' },
  { key: 20, label: '20' },
  { key: 50, label: '50' },
  { key: 100, label: '100' },
]
const currentPage = ref(1)
const currentPerPage = ref(15)
const changePage = page => {
  currentPage.value = page
}
const changePerPage = perPage => {
  currentPerPage.value = perPage
}

Only pages

When you want to show only the pages, you can use the show-per-page-drop-down prop to hide the per page dropdown and pass the total pages to the total-pages prop.

...
Vue
html
<template>
  <HLPagination
    :current-page="currentPage"
    :total-pages="18"
    :show-per-page-drop-down="false"
    :pages-to-display="7"
    @update:page="changePage"
    size="md"
    show-current-range
    :show-total-pages="false"
  >
    <template #prev> Previous </template>
    <template #next> Next </template>
  </HLPagination>
</template>
<script setup>
  import { HLPagination } from '@platform-ui/highrise'
  import { ref } from 'vue'
  const currentPage = ref(1)
  const changePage = page => {
    currentPage.value = page
  }
</script>

Imports

Vue
ts
import { HLPagination } from '@platform-ui/highrise'

Props

PropTypeDefaultDescription
id *string | undefinedundefinedUnique identifier for the elemnt
currentPagenumber1Current active page
itemCount *number | undefinedundefinedTotal number of items
perPage *number10Number of items per page
pagesToDisplaynumber7Number of page buttons to display
perPageTextstring'Rows per page'Label for per-page dropdown
perPageDropdownOptionsArray<{ key: number; label: string }>[]Options for items per page dropdown
size'md'| 'sm''md'Size of pagination ('sm' or 'md')
collapsedbooleanfalseWhether to show collapsed version
showCurrentRangebooleantrueWhether to show current range
showTotalPagesbooleanfalseWhether to show total pages
isPageDropDownbooleanfalseWhether to show page selection dropdown
showPerPageDropDownbooleanfalseWhether to show per page selection dropdown
totalPages *numberundefinedTotal number of pages is required when there is no perPage and itemCount

Emits

EventParametersDescription
@update:page(page: number)Emitted when page changes
@update:perPage(perPage: number)Emitted when items per page changes

Slots

NameDescription
prevCustom content for previous page button
nextCustom content for next page button