Pagination

import { Pagination } from '@megafon/ui-core';
Код DemoPaginationWrapper
type childrenPropTypes = {
totalPages: number;
activePage: number;
theme?: 'default' | 'light';
onChange: (value: number) => void;
};
interface IDemoPaginationWrapperProps {
children: (prop: childrenPropTypes) => JSX.Element;
totalPages: number;
activePage: number;
}
export const DemoPaginationWrapper: React.FC<IDemoPaginationWrapperProps> = ({ activePage, children, ...props }) => {
const [currentActivePage, setCurrentActivePage] = React.useState(activePage);
const childrenProps: childrenPropTypes = {
...props,
activePage: currentActivePage,
onChange: setCurrentActivePage,
};
return children(childrenProps);
};

Состояния боковых стрелок

Выбрана первая страница

Выбрана не крайняя страница

Выбрана последняя страница

Частичное скрытие списка страниц

Выбрана страница в начале списка

Выбрана страница в середине списка

Выбрана страница в конце списка

Светлая тема