- Accordion new
- ActionSheet new
- Alert new
- Alert Dialog new
- Angle Slider new
- Autocomplete new
- Avatar new
- Badge new
- Breadcrumb new
- Button new
- Button Group new
- Card new
- Carousel new
- Checkbox new
- Clipboard new
- Collapsible new
- Color Picker new
- Date Input new
- Date Picker new
- Dialog new
- DialogCaller new
- Drawer beta
- Editable new
- Empty new
- Field new
- Fieldset new
- File Upload new
- Filters new
- Floating Panel new
- Hover Card new
- Image new
- Image Cropper new
- Input new
- Input Group new
- Json Tree View new
- Kbd new
- Listbox new
- Marquee new
- Menu new
- Number Input new
- Pagination new
- Password Input new
- PhoneField new
- Pin Input new
- Popover new
- Progress Circular new
- Progress Linear new
- Qr Code new
- Radio Group new
- Rating Group new
- Scroll Area new
- ScrollSpy new
- Segment Group new
- Select new
- Separator new
- Sidebar new
- Signature Pad new
- Skeleton new
- Slider new
- Splitter new
- Steps new
- Switch new
- Table new
- Tabs new
- Tags Input new
- Textarea new
- Timeline new
- Timer new
- Toast new
- Toc new
- Toggle new
- Toggle Group new
- Tooltip new
- Tour new
- Tree View new
- Typography new
Pagination
Vue pagination controls to navigate multi-page lists and tables with page size and ranges.
Installation
Install from the Vuzeno registry:
bunx --bun shadcn-vue@latest add https://vuzeno.com/r/pagination.json
npx shadcn-vue@latest add https://vuzeno.com/r/pagination.json
yarn dlx shadcn-vue@latest add https://vuzeno.com/r/pagination.json
pnpm dlx shadcn-vue@latest add https://vuzeno.com/r/pagination.json
Usage
<script setup lang="ts">
import { Pagination } from "@/components/ui/pagination";
</script>
<template>
<Pagination.Root>
<!-- … -->
</Pagination.Root>
</template>
Composition
Pagination.Root
├── Pagination.Context
├── Pagination.Ellipsis
├── Pagination.FirstTrigger
├── Pagination.Item
├── Pagination.LastTrigger
├── Pagination.NextTrigger
├── Pagination.PrevTrigger
├── Pagination.RootProvider
Examples
Controlled
To create a controlled Pagination component, manage the state of the current page using the page prop and update it when the onPageChange event handler is called:
Root Provider
An alternative way to control the pagination is to use the RootProvider component and the usePagination hook. This way you can access the state and methods from outside the component.
Customization
You can customize the Pagination component by setting various props such as dir, pageSize, siblingCount, and translations. Here's an example of a customized Pagination:
Context
Access pagination state and methods with Pagination.Context or the usePaginationContext hook. You get methods like setPage, setPageSize, goToNextPage, goToPrevPage, goToFirstPage, goToLastPage, as well as properties like totalPages and pageRange.
Data Slicing
Use the slice() method to paginate actual data arrays. This method automatically slices your data based on the current page and page size.
Page Range
Display the current page range information using the pageRange property. This shows which items are currently visible (e.g., "Showing 1-10 of 100 results").
Page Size
Control the number of items per page dynamically using setPageSize(). This example shows how to integrate a native select element to change the page size.
Note: For uncontrolled behavior, use
defaultPageSizeto set the initial value. For controlled behavior, usepageSizeandonPageSizeChangeto programmatically manage the page size.
Links
Create pagination with link navigation for better SEO and accessibility. This example shows how to use the pagination component with anchor links instead of buttons.
API
See Ark UI Pagination docs for full props and examples.