pagination

Implement offset- and cursor-based pagination for SwiftUI lists and feeds.

Updated Jun 2, 2026
One-click install
npx skills add https://github.com/ano4l/SiteRent --skill pagination-ano4l
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pagination
Source: https://github.com/ano4l/SiteRent/tree/main/skills/generators/pagination
Command: npx skills add https://github.com/ano4l/SiteRent --skill pagination-ano4l

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Efficiently implementing pagination for large lists and feeds across apps can be error-prone and labor-intensive. This Skill provides a production-ready pagination infrastructure that supports both offset-based and cursor-based loading patterns, enabling smooth infinite scrolling and robust data loading.

Core Features & Use Cases

  • Offset and cursor pagination: Supports traditional page-based APIs and cursor-driven streams for real-time data workloads.
  • Stateful pagination management: Includes a comprehensive state machine (idle, loading, loaded, loadingMore, exhausted, error) with prefetching to optimize UX.
  • SwiftUI integration: Provides ready-to-use patterns and adapters for building scrollable lists with automatic pagination, error handling, and empty states.
  • Search-ready flow: Optional adapters to combine pagination with debounced search queries for dynamic datasets.

Quick Start

Instantiate a pagination data source, attach it to a PaginationManager, and call loadFirstPage() to fetch the initial data.

Frequently Asked Questions about pagination

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement cursor-based pagination for infinite scrolling in Swift?

Cursor-based pagination for infinite scrolling uses a stateful PaginationManager with a generic data source protocol to fetch sequential pages. This provides a state machine handling loading, exhausted, and error states while prefetching upcoming data.

What is the difference between offset and cursor pagination for REST and GraphQL APIs?

Offset pagination fetches specific page numbers using traditional indexing, while cursor pagination uses unique dataset markers for real-time streams. This infrastructure supports both patterns across REST and GraphQL endpoints for loading lists and feeds.

Can I add debounced search queries to a paginated list in SwiftUI?

Yes, you can add debounced search to paginated SwiftUI lists using the provided search adapter. It combines dynamic query inputs with the pagination infrastructure to filter datasets while maintaining scroll state.

How do I handle pagination state management for loading and error states in mobile apps?

Pagination state management handles loading states through a comprehensive state machine tracking idle, loaded, loadingMore, exhausted, and error conditions. This manages transitions automatically during data fetching to optimize user experience.

Does this pagination infrastructure work with both mobile and web applications?

Yes, the pagination infrastructure applies to both mobile and web applications requiring paginated APIs. It provides SwiftUI integration scaffolds for iOS alongside generic protocols supporting infinite scrolling across platforms.

What's the best way to prefetch data for infinite scroll feeds to optimize UX?

Prefetching for infinite scroll feeds is handled by the stateful PaginationManager which anticipates upcoming data requests. It automatically fetches subsequent pages before the user reaches the end of the current list.