Our React and Tailwind CSS pagination that can be used to show a user how to navigate between different pages of table or a group of elements.
Below we are presenting our examples of pagination component build using Button, IconButton and ButtonGroup components that you can use in your Tailwind CSS and React project.
Here's how to implement a simple and responsive pagination using Button and IconButton components. It can be used for the action of navigating between pages in a table or a group of elements.
In the example below we've used the Iconoir icons, but you can use any other icon library you prefer.
"use client";
import { Button, IconButton } from "@material-tailwind/react";
import { NavArrowRight, NavArrowLeft } from "iconoir-react";
Use this example for a pagination group using IconButton and ButtonGroup components. It's useful when you want to group all the pages and actions together.
In the example below we've used the Iconoir icons, but you can use any other icon library you prefer.
"use client";
import { IconButton, ButtonGroup } from "@material-tailwind/react";
import { NavArrowRight, NavArrowLeft } from "iconoir-react";
export function PaginationGroup() {
return (
<ButtonGroup>
<IconButton variant="outline">
<NavArrowLeft className="h-4 w-4 stroke-2" />
</IconButton>
<IconButton variant="outline">1</IconButton>
<IconButton>2</IconButton>
<IconButton variant="outline">3</IconButton>
<IconButton variant="outline">4</IconButton>
<IconButton variant="outline">5</IconButton>
<IconButton variant="outline">
<NavArrowRight className="h-4 w-4 stroke-2" />
</IconButton>
</ButtonGroup>
);
}
"use client";
import { IconButton, ButtonGroup } from "@material-tailwind/react";
import { NavArrowRight, NavArrowLeft } from "iconoir-react";