Pagination
Pagination links to the pages of a long list or table. Use it when results are split across pages. Your app decides which page numbers to show.
Installation
Run npx nxds-cli@latest init first if nxds isn’t set up in your app yet. See Install.
Usage
Composition
Examples
Few pages
Show every page number when they all fit, with no ellipsis.
As child
Pass asChild to render each link as your router's link component.
Props
Pagination
Pagination adds no props of its own; it accepts the props of the element or primitive it wraps.
PaginationContent
PaginationContent adds no props of its own; it accepts the props of the element or primitive it wraps.
PaginationEllipsis
PaginationEllipsis adds no props of its own; it accepts the props of the element or primitive it wraps.
PaginationItem
PaginationItem adds no props of its own; it accepts the props of the element or primitive it wraps.
PaginationLink
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | false | Renders the child element, such as a router |
isActive | boolean | No default documented | Marks the link as the current page and sets |
size | "default" | "sm" | "lg" | "icon-sm" | "icon" | "icon-lg" | null | "icon" | No description |
PaginationNext
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | false | Renders the child element, such as a router |
isActive | boolean | No default documented | Marks the link as the current page and sets |
size | "default" | "sm" | "lg" | "icon-sm" | "icon" | "icon-lg" | null | "default" | No description |
PaginationPrevious
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | false | Renders the child element, such as a router |
isActive | boolean | No default documented | Marks the link as the current page and sets |
size | "default" | "sm" | "lg" | "icon-sm" | "icon" | "icon-lg" | null | "default" | No description |
Pagination links to the pages of a long list or table. Use it when results are split across pages. Your app decides which page numbers to show.
Installation
Install these components first:
Copy and paste the following code into your project.
components/pagination/Pagination.vue components/pagination/PaginationContent.vue components/pagination/PaginationEllipsis.vue components/pagination/PaginationItem.vue components/pagination/PaginationLink.vue components/pagination/PaginationNext.vue components/pagination/PaginationPrevious.vue components/pagination/index.ts Keep each file at the path shown above it.
Paths are relative to
packages/vue/src/. Keep the same folders under your@/root, and the imports between files work without edits.
Usage
Examples
Few pages
Show every page number when they all fit, with no ellipsis.
As child
Pass as-child to render each link as your router's link component.
Props
Pagination
Pagination adds no props of its own; it accepts the props of the element or primitive it wraps.
PaginationContent
PaginationContent adds no props of its own; it accepts the props of the element or primitive it wraps.
PaginationEllipsis
PaginationEllipsis adds no props of its own; it accepts the props of the element or primitive it wraps.
PaginationItem
PaginationItem adds no props of its own; it accepts the props of the element or primitive it wraps.
PaginationLink
| Prop | Type | Default | Description |
|---|---|---|---|
isActive | boolean | No default documented | Marks the link as the current page and sets |
size | "default" | "sm" | "lg" | "icon-sm" | "icon" | "icon-lg" | null | "icon" | No description |
PaginationNext
| Prop | Type | Default | Description |
|---|---|---|---|
isActive | boolean | No default documented | Marks the link as the current page and sets |
size | "default" | "sm" | "lg" | "icon-sm" | "icon" | "icon-lg" | null | "default" | No description |
PaginationPrevious
| Prop | Type | Default | Description |
|---|---|---|---|
isActive | boolean | No default documented | Marks the link as the current page and sets |
size | "default" | "sm" | "lg" | "icon-sm" | "icon" | "icon-lg" | null | "default" | No description |