Pagination
A comprehensive pagination component with navigation controls, page numbers, and ellipsis indicators. Perfect for navigating through large datasets.
Import
import { Pagination } from "@sparrowengg/twigs-react";Usage
const PaginationExample = () => {
const [activePage, setActivePage] = useState(1);
return (
<Box css={{ display: "flex", flexDirection: "column", gap: "$6", alignItems: "center" }}>
<Flex gap="$4" alignItems="center">
<Pagination
activePage={activePage}
itemsPerPage={10}
total={100}
onChange={(event, page) => setActivePage(page)}
/>
</Flex>
</Box>
);
};Examples
Advanced Pagination
Comprehensive example showing different pagination configurations with various sizes, sibling counts, and page ranges.
Props
Pagination
| Prop | Type | Default |
|---|---|---|
total? | number | - |
itemsPerPage? | number | - |
activePage? | number | - |
siblingCount? | number | 1 |
onChange? | (event: SyntheticEvent, page: number) => void | - |
size? | 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'sm' |
css? | object | - |
Link
A flexible link component that renders as a styled anchor element with composition support. Perfect for navigation, external links, and custom link implementations.
Stepper
A multi-step navigation component that guides users through a sequence of related actions. Perfect for forms, wizards and complex workflows.