Skip to content

Conversation

@owjs3901
Copy link
Contributor

  • 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

- 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>
@owjs3901 owjs3901 closed this Dec 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants