WlPagination

Pagination with page numbers and ellipses. Compact mode enters the page number in an input.
Components / Data v0.1.0

Limits

Page 1 of 12

Full example
<div class="wl-stack" data-space="md">
  <WlPagination v-model:page="page" :page-count="12"  />
  <p class="wl-text-small" role="status">{{ "Page" }} {{ page }} {{ "of 12" }}</p>
</div>

Appearance

Page 1 of 12

Full example
<div class="wl-stack" data-space="md">
  <WlPagination v-model:page="page" :page-count="12"  />
  <p class="wl-text-small" role="status">{{ "Page" }} {{ page }} {{ "of 12" }}</p>
</div>

Page list and compact input

Ellipses, two named navigation regions, Enter/blur for compact page numbers and disabled.

Default: 6 of 12. Compact: 2 of 9.

The compact field applies the page number on Enter or blur. The value is clamped to the available range.

Full example
<script setup lang="ts">
import { WlCheckbox, WlPagination } from "legato-ui";
import { ref } from "vue";
const page = ref(6);
const compactPage = ref(2);
const disabled = ref(false);
</script>

<template>
  <div class="wl-stack" data-space="lg">
    <WlCheckbox v-model="disabled">{{ "Disable page navigation" }}</WlCheckbox>
    <WlPagination
      v-model:page="page"
      :page-count="12"
      :siblings="1"
      :disabled="disabled"
      :pt="{ root: { 'aria-label': 'Material pages' } }"
    />
    <WlPagination
      v-model:page="compactPage"
      :page-count="9"
      compact
      :disabled="disabled"
      :pt="{ root: { 'aria-label': 'Compact material pages' } }"
    />
    <p class="wl-text-small" role="status">
      {{ "Default:" }} {{ page }} {{ "of 12. Compact:" }}
      {{ compactPage }} {{ "of 9." }}
    </p>
    <p class="wl-text-small wl-text-muted">{{ "The compact field applies the page number on Enter or blur. The value is clamped to the available range." }}</p>
  </div>
</template>