Closed
Conversation
- Add Pagination component with Context API for state management - Implement composable sub-components: - PaginationContainer: Container for pagination elements - PaginationPrevButton: Previous page navigation button - PaginationNextButton: Next page navigation button - PaginationPageButton: Individual page number button - PaginationPages: Smart page number renderer with ellipsis - PaginationEllipsis: Ellipsis indicator for skipped pages - Add usePagination hook for accessing pagination context - Include IconChevronLeft and IconChevronRight icons - Add comprehensive test suite - Add Storybook stories with multiple examples - Export all components from main index.ts Features: - Controlled and uncontrolled mode support - Configurable sibling count for page numbers - Optional first/last page display - Automatic ellipsis for large page ranges - Disabled states for navigation buttons at boundaries - Accessible ARIA labels and attributes
- Allow Pagination to render without children using props
- Add showPrevNext prop to toggle prev/next buttons (default: true)
- Add className prop to customize container styling
- Update Storybook stories with new usage patterns:
- PropsBasedSimple: Simple props-based example
- WithoutPrevNext: Example without navigation buttons
- CompositionBased: Original composition pattern
- CustomClassName: Example with custom styling
- Add comprehensive tests for new props-based API
- Maintain backward compatibility with composition pattern
Usage:
// Props-based (new)
<Pagination totalPages={10} />
// Composition-based (original)
<Pagination totalPages={10}>
<PaginationContainer>
<PaginationPrevButton />
<PaginationPages />
<PaginationNextButton />
</PaginationContainer>
</Pagination>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Features: