Skip to main content

Overview

The HuxPagination component provides an intuitive way to navigate through multiple pages of content. It displays page numbers with intelligent ellipsis handling for large page counts and includes previous/next arrow buttons.

Basic Usage

Properties

Examples

Basic Pagination

Large Page Count

When you have many pages, the component automatically shows ellipsis:

Custom Page Range

Accessibility

The HuxPagination component is built with accessibility in mind:
  • WCAG AA Compliant: Uses proper contrast ratios for all text and backgrounds
  • Keyboard Navigation: All buttons are focusable and keyboard accessible
  • Screen Reader Support: Proper semantic markup and ARIA labels
  • Touch Targets: Meets minimum touch target size requirements

Styling

The component uses Hux’s design tokens for consistent theming:
  • Theme-aware colors: Automatically adapts to light/dark themes
  • Consistent spacing: Uses Hux spacing tokens
  • Typography: Follows Hux text style patterns
  • Interactive states: Proper hover and focus states
The pagination component automatically handles edge cases like single page scenarios and ensures the current page is always visible in the page range.

Best Practices

  1. Always provide feedback: Use the onPageChanged callback to update your content
  2. Handle edge cases: The component handles single pages and large page counts automatically
  3. Consider mobile: The compact design works well on mobile devices
  4. Accessibility: Ensure your page content changes are announced to screen readers