pagination

Generate pagination infrastructure for Swift apps with offset and cursor APIs.

114|8|Updated Mar 4, 2025
One-click install
npx skills add https://github.com/gustavscirulis/snapgrid --skill pagination-gustavscirulis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pagination
Source: https://github.com/gustavscirulis/snapgrid/tree/main/.claude/skills/skills/generators/pagination
Command: npx skills add https://github.com/gustavscirulis/snapgrid --skill pagination-gustavscirulis

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and scripts (resource) components.

What problem does it solve?

This Skill streamlines the implementation of paginated lists, infinite scrolling, and load-more functionality, significantly improving user experience for data-heavy interfaces.

Core Features & Use Cases

  • Flexible Pagination: Supports both offset-based and cursor-based API patterns.
  • Dynamic Loading: Implements infinite scroll or manual "Load More" buttons.
  • Integrated Search: Seamlessly adds search capabilities to paginated lists.
  • Use Case: When building a social media feed or a large product catalog, this Skill ensures smooth loading of content as the user scrolls, preventing long wait times and providing a fluid browsing experience.

Quick Start

Use the pagination skill to add infinite scrolling to your user list.

Frequently Asked Questions about pagination

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

FAQPage Schema
How do I implement infinite scroll in SwiftUI with paginated API data?

Implementing infinite scroll in SwiftUI requires generating pagination infrastructure that automatically fetches paginated API data as the user scrolls. This Skill provides that infrastructure, managing state transitions for loading and prefetching to ensure smooth data loading.

What is the best way to handle state management for offset and cursor-based pagination?

Handling state management for offset and cursor-based pagination is best managed through a dedicated state machine. This approach robustly tracks loading, error handling, and prefetching states, preventing duplicate fetches and ensuring data consistency during dynamic list loading.

Can I add search functionality to an existing infinite scroll list in Swift?

Yes, you can add search functionality to an existing infinite scroll list. The pagination infrastructure integrates search capabilities directly, allowing users to query filtered results while maintaining seamless infinite scroll or manual load more behaviors.

Does this pagination approach support both offset and cursor-based API patterns?

Yes, this pagination approach supports both offset and cursor-based API patterns. It generates production-ready infrastructure tailored to your specific backend API design, ensuring compatibility whether your API relies on page offsets or cursor tokens for data loading.

How do I prevent long wait times when loading a large product catalog in a Swift app?

To prevent long wait times when loading a large product catalog, implement prefetching and dynamic data loading. This Skill optimizes user experience by fetching data incrementally via infinite scroll before the user reaches the end of the visible list.