Data display
Layout
Pagination
Page-number controls that split a long list or table across pages. Use it when people need to reach a specific page.
Install
import { Pagination } from 'vael-ui'Playground
Usage
<script setup lang="ts">
import { Pagination } from 'vael-ui'
</script>
<template>
<Pagination :total="132" />
</template>Motion New
Pagination: its appearance, and how the current-page indicator moves.
<Pagination
:motion="{ initial: { root: { opacity: 0, y: 4 } } }"
/>| Name | Type | Description |
|---|---|---|
initialexit | rootbuttonindicator | Sets where each part comes in from and leaves to: any CSS property, plus x, y and blur. A plain number is px, or degrees for rotate. |
enterleave | (parts, context) => animation | Animates the parts with GSAP, motion or element.animate(). Return the animation and the component waits for it, and stops it if interrupted. |
move | (parts, context) => animation | Moves its sliding indicator. A spring retimes it, and a move hook animates it with your own library, starting from context.from. |
springdurationeasing | { damping, response } | number | string | Times all of it: a spring, or a duration in ms with an easing. Never both. |
false | boolean | Turns its motion off, for an animation of your own on its exposed elements. |
Accessibility
| Key | Action |
|---|---|
| TabShiftTab | Moves between the page buttons and the page size Select. |
| EnterSpace | Goes to the focused page, or to the first, previous, next or last page. |
- The root is a
<nav>named “Pagination”, and the buttons sit in a<ul>. - The current page button has
aria-current="page", and each page button is named “Page 3”, “Page 4” and so on. - The first, previous, next and last buttons have their own names. At either end they set
aria-disabled, so they keep focus. - The ellipsis, the indicator and the hover highlight are
aria-hidden. The page size Select is named “Rows per page”.