diff --git a/src/sections/Projects/Sistent/components/content.js b/src/sections/Projects/Sistent/components/content.js index ca8d04d14ab4..741bd1f19f60 100644 --- a/src/sections/Projects/Sistent/components/content.js +++ b/src/sections/Projects/Sistent/components/content.js @@ -103,6 +103,14 @@ const componentsData = [ url: "/projects/sistent/components/toggle-button", src: "/toggle-button", }, + { + id: 14, + name: "Pagination", + description: + "Pagination enables users to navigate through multiple pages of content, providing an intuitive interface for browsing large datasets or segmented information.", + url: "/projects/sistent/components/pagination", + src: "/pagination", + }, ]; module.exports = { componentsData }; diff --git a/src/sections/Projects/Sistent/components/pagination/code.js b/src/sections/Projects/Sistent/components/pagination/code.js new file mode 100644 index 000000000000..4729eff956d2 --- /dev/null +++ b/src/sections/Projects/Sistent/components/pagination/code.js @@ -0,0 +1,180 @@ +import React, { useState } from "react"; +import { navigate } from "gatsby"; +import { useLocation } from "@reach/router"; +import { Pagination, SistentThemeProvider } from "@layer5/sistent"; +import { SistentLayout } from "../../sistent-layout"; +import { CodeBlock } from "../button/code-block"; +import TabButton from "../../../../../reusecore/Button"; +import { useStyledDarkMode } from "../../../../../theme/app/useStyledDarkMode"; + +const codes = [ + // Basic pagination + ` + handleChange(page)} + /> + `, + // Pagination with size variants + ` + + + + `, + // Pagination with custom styling + ` + + `, + // Pagination with an outline + ` + + `, +]; + +const PaginationCode = () => { + const { isDark } = useStyledDarkMode(); + const location = useLocation(); + const [currentPage, setCurrentPage] = useState(1); + + const handlePageChange = (event, value) => { + setCurrentPage(value); + }; + + return ( + +
+ +

Pagination

+
+

+ The Pagination component helps users navigate through multiple pages + of content. It provides a clear interface for moving between pages and + understanding the current position within a larger dataset. +

+
+ navigate("/projects/sistent/components/pagination")} + title="Overview" + /> + + navigate("/projects/sistent/components/pagination/guidance") + } + title="Guidance" + /> + + navigate("/projects/sistent/components/pagination/code") + } + title="Code" + /> +
+
+ {/* Basic Pagination */} + +
+
+ + + +
+ +
+ + {/* Pagination Sizes */} + +

Pagination Sizes

+
+
+
+ +
+ + + +
+
+
+ +
+ + {/* Custom Styling */} + +

Custom Styling

+
+
+
+ + + +
+ +
+ + {/* Pagination with Outline */} + +

Pagination with Outline

+
+
+
+ + + +
+ +
+
+
+
+ ); +}; + +export default PaginationCode; \ No newline at end of file diff --git a/src/sections/Projects/Sistent/components/pagination/guidance.js b/src/sections/Projects/Sistent/components/pagination/guidance.js new file mode 100644 index 000000000000..e37d297611f3 --- /dev/null +++ b/src/sections/Projects/Sistent/components/pagination/guidance.js @@ -0,0 +1,111 @@ +import React from "react"; +import { navigate } from "gatsby"; +import { useLocation } from "@reach/router"; +import { Row } from "../../../../../reusecore/Layout"; +import { SistentThemeProvider, Pagination } from "@layer5/sistent"; +import { SistentLayout } from "../../sistent-layout"; +import TabButton from "../../../../../reusecore/Button"; +import { useStyledDarkMode } from "../../../../../theme/app/useStyledDarkMode"; + +const PaginationGuidance = () => { + const location = useLocation(); + const { isDark } = useStyledDarkMode(); + + return ( + +
+ +

Pagination

+
+

+ The Pagination component helps users navigate through multiple pages + of content. It provides a clear interface for moving between pages and + understanding the current position within a larger dataset. +

+ +
+ navigate("/projects/sistent/components/pagination")} + title="Overview" + /> + + navigate("/projects/sistent/components/pagination/guidance") + } + title="Guidance" + /> + + navigate("/projects/sistent/components/pagination/code") + } + title="Code" + /> +
+ +
+ +

Usage Guidelines

+
+ +

When to Use

+

+ Pagination should be used when displaying large datasets that need + to be broken into manageable chunks. It helps users navigate through + multiple pages of content and is beneficial when content needs to be + loaded incrementally to improve performance. +

+ +

Best Practices

+

+ To ensure a smooth user experience, it’s important to keep page + sizes consistent throughout the interface. The current page number + and total pages should be displayed clearly. Adequate spacing + between page numbers should be ensured to improve readability. It’s + also crucial to provide clear visual feedback for the current page. + For large page ranges, consider using ellipsis (...) to represent + skipped pages. +

+ +

Accessibility

+

+ To make pagination more accessible, ensure that ARIA labels are used + to identify the pagination controls. Keyboard navigation should be + properly supported to allow users to navigate through the pages + easily. It’s important to provide clear visual indicators for focus + states and maintain adequate color contrast for all states to ensure + readability. +

+ + + + + + +
+
+
+ ); +}; + +export default PaginationGuidance; \ No newline at end of file diff --git a/src/sections/Projects/Sistent/components/pagination/index.js b/src/sections/Projects/Sistent/components/pagination/index.js new file mode 100644 index 000000000000..0c2e2e1a9430 --- /dev/null +++ b/src/sections/Projects/Sistent/components/pagination/index.js @@ -0,0 +1,168 @@ +import React, { useState } from "react"; +import { navigate } from "gatsby"; +import { useLocation } from "@reach/router"; +import { SistentThemeProvider, Pagination, Box } from "@layer5/sistent"; +import TabButton from "../../../../../reusecore/Button"; +import { SistentLayout } from "../../sistent-layout"; +import { Row } from "../../../../../reusecore/Layout"; +import { useStyledDarkMode } from "../../../../../theme/app/useStyledDarkMode"; + +const SistentPagination = () => { + const location = useLocation(); + const { isDark } = useStyledDarkMode(); + const [page, setPage] = useState(1); + + const handleChange = (event, value) => { + setPage(value); + }; + + return ( + +
+ +

Pagination

+
+

+ The Pagination component helps users navigate through multiple pages + of content. It provides a clear interface for moving between pages and + understanding the current position within a larger dataset. +

+
+ navigate("/projects/sistent/components/pagination")} + title="Overview" + /> + + navigate("/projects/sistent/components/pagination/guidance") + } + title="Guidance" + /> + + navigate("/projects/sistent/components/pagination/code") + } + title="Code" + /> +
+
+

+ Pagination is an essential element for navigating large datasets or + multiple pages of information. It enables users to move between + pages in a user-friendly and intuitive manner. Pagination helps to + split large content into smaller sections to improve the overall + user experience. +

+ + +

Basic Usage

+
+

+ Basic pagination allows users to navigate through numbered pages. + The current page is highlighted, and users can click on page numbers + or arrows to move between pages. +

+ + + + + + + +

Variants

+
+

+ The Pagination component supports multiple variants to match your + design needs, including outlined, text, and contained styles. These + variants provide flexibility in integrating the component into your + layout while maintaining a consistent visual appearance. +

+ + + + + + + + + + +

Sizes

+
+

+ The Pagination component can also be customized in terms of size to + suit different use cases. For smaller screens, compact pagination + may be preferred, while larger pagination can be used for better + visibility on larger screens. +

+

Large

+

+ A larger pagination component that enhances visibility and + interaction on larger displays. +

+ + + + + + +

Medium

+

+ A medium-sized pagination component that balances compactness and + visibility. +

+ + + + + + +

Small

+

+ A smaller pagination component suitable for compact designs or when + screen real estate is limited. +

+ + + + + +
+
+
+ ); +}; + +export default SistentPagination; \ No newline at end of file