Skip to content

Pagination

EPagination uses a numbering system to make it simple for users to browse a webpage. It divides a webpage into many pages, making it easier for viewers to locate what they're searching for. Demo Here

Import

jsx
import EPagination from "@components/Elements/EPagination";

Usage

jsx
const PaginationExample = () => {
  const [page, setPage] = useState(1);

  const handleChange = (event, value) => {
    setPage(value);
  };

  return <EPagination totalCount={5} value={page} onChange={handleChange} />;
};

export default PaginationExample;

Props

For EPagination component, the following props are available:

PropTypeDefaultNote
valueNumber-Current page state
totalCountNumber5Specifies pagination length.
disabledBooleanfalseDisables the pagination buttons.
roundedBooleanfalseIt creates a circular pagination buttons.
squareBooleanfalseRemoves rounded corners of the element.
classNameString-Overrides or extends the component's wrapper styles.
siblingCountNumber1Specifies the number of sibling buttons when the limit is exceeded
sizeString"md"The EPagination element has three predefined sizes: sm, md, lg.
customColorString-A custom color in rgb format is applied to the btn (e.g, customColor="101, 89, 204").
alignString"start"Specifies how the pagination buttons are distributed along the cross axis in a container.
nextIconObject-Customizes the next icon of the pagination. More Info about icons here.
prevIconObject-Customizes the previous icon of the pagination. More Info about icons here.
colorString"primary"The given color is applied to the pagination buttons - utility colors are supported (e.g primary or danger). you'll find a list of built-in classes on the src/styles/_vars.scsspage.
variantString"fill"Pagination buttons can be represented in two ways: fill, alternate, outline ,text. alternate displays the btn with a light background, outline draws a border around an element and text displays the btn with only text and no background color.

Callback Functions

The EPagination component contains following callback functions.

FunctionDescription
onChangeProp that you pass to control the active page. function(event: React.SyntheticEvent, currentPage: Number) => void 👇

event: The event source of the callback.
currentPage: current page value.

COPYRIGHT