Paginations
Overview
Pagination helps to chunk a massive data from server which can decrease your website performance.
JSXPine has two types of pagination: input and select. Discover what you can achieve below.
Input Pagination
Input Pagination is a set of input type number and buttons.
By changing the intput number, you get back this value and can perform a navigation.
/
Copied !
import { InputPagination } from "$components/pagination.component";
export function InputPaginationExample() {
return (
<InputPagination
x-init={`
$watch("selectedPage", (value) => {
console.log({ selectedPage: value });
})
`}
pages={20}
class="[&_input]:w-24"
selectedPage={3}
/>
);
}
Select Pagination
Select Pagination is Select component instead of input. The pages number is display in the select list.
Copied !
import { SelectPagination } from "$components/pagination.component";
export function SelectPaginationExample() {
return (
<SelectPagination
x-init={`
$watch("selectedPage", (value) => {
console.log({ selectedPage: value });
})
`}
pages={20}
class="[&_input]:w-24"
selectedPage={3}
/>
);
}