diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index fe1830a..649fdf6 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -44,6 +44,7 @@ function getComponents() { { text: 'Card', link: 'components/card.md' }, { text: 'Carousel', link: 'components/carousel' }, { text: 'Dropdown', link: '/components/dropdown' }, + { text: 'Pagination', link: 'components/pagination' }, { text: 'Progress', link: 'components/progress' }, { text: 'Rating', link: 'components/rating' }, { text: 'Spinner', link: '/components/spinner' }, @@ -57,7 +58,6 @@ function getComponents() { { text: 'Navbar', link: 'components/navbar' }, { text: '- Footer', link: 'components/footer' }, - { text: '- Pagination', link: 'components/pagination' }, { text: '- Sidebar', link: 'components/sidebar' }, ] } diff --git a/docs/components/pagination.md b/docs/components/pagination.md index c4388f2..f752709 100644 --- a/docs/components/pagination.md +++ b/docs/components/pagination.md @@ -1,15 +1,119 @@ # Vue Pagination Component - Flowbite +## Default pagination + ```vue +``` + + +## Default with custom length +You can use your own pages count in the row by passing props: `slice-length` +This prop means left side and right side pages row slicing. In the example it has value `4`. So row length will be 4 + 1 + 4 pages - 9 pages. + +```vue + + ``` - + + +## Pagination with navigation layout + +```vue + + +``` + + + +## Pagination with table layout +To use that layout you have to pass required props: +- `per-page`: it's items count displayed on each page. +- `total-items`: it's the total items count. + +And there you don't need to use `total-pages` prop. + +```vue + + +``` + + + +## Pagination with icons + +```vue + + +``` + + + +## Pagination with custom labels + +```vue + + +``` + diff --git a/docs/components/pagination/examples/PaginationExample.vue b/docs/components/pagination/examples/PaginationExample.vue index 548b3f3..b1322db 100644 --- a/docs/components/pagination/examples/PaginationExample.vue +++ b/docs/components/pagination/examples/PaginationExample.vue @@ -1,8 +1,11 @@ - diff --git a/docs/components/pagination/examples/PaginationNavigationExample.vue b/docs/components/pagination/examples/PaginationNavigationExample.vue new file mode 100644 index 0000000..1f6e9b7 --- /dev/null +++ b/docs/components/pagination/examples/PaginationNavigationExample.vue @@ -0,0 +1,11 @@ + + diff --git a/docs/components/pagination/examples/PaginationTableExample.vue b/docs/components/pagination/examples/PaginationTableExample.vue new file mode 100644 index 0000000..8a3105a --- /dev/null +++ b/docs/components/pagination/examples/PaginationTableExample.vue @@ -0,0 +1,16 @@ + + diff --git a/docs/components/pagination/examples/PaginationWithCustomSlice.vue b/docs/components/pagination/examples/PaginationWithCustomSlice.vue new file mode 100644 index 0000000..ce14e87 --- /dev/null +++ b/docs/components/pagination/examples/PaginationWithCustomSlice.vue @@ -0,0 +1,11 @@ + + diff --git a/docs/components/pagination/examples/PaginationWithCustomTextExample.vue b/docs/components/pagination/examples/PaginationWithCustomTextExample.vue new file mode 100644 index 0000000..2553685 --- /dev/null +++ b/docs/components/pagination/examples/PaginationWithCustomTextExample.vue @@ -0,0 +1,11 @@ + + diff --git a/docs/components/pagination/examples/PaginationWithIconsExample.vue b/docs/components/pagination/examples/PaginationWithIconsExample.vue new file mode 100644 index 0000000..aaead23 --- /dev/null +++ b/docs/components/pagination/examples/PaginationWithIconsExample.vue @@ -0,0 +1,11 @@ + + diff --git a/src/components/Pagination/Pagination.vue b/src/components/Pagination/Pagination.vue index 6df6137..3c25526 100644 --- a/src/components/Pagination/Pagination.vue +++ b/src/components/Pagination/Pagination.vue @@ -1,51 +1,162 @@ diff --git a/src/components/Pagination/types.ts b/src/components/Pagination/types.ts new file mode 100644 index 0000000..15bf6b6 --- /dev/null +++ b/src/components/Pagination/types.ts @@ -0,0 +1 @@ +export type PaginationLayout = 'navigation' | 'pagination' | 'table'