cbpaginator

Generate server-side pagination metadata for ColdBox/BoxLang applications.

1|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/ColdBox/skills --skill cbpaginator
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: cbpaginator
Source: https://github.com/ColdBox/skills/tree/main/modules/cbpaginator
Command: npx skills add https://github.com/ColdBox/skills --skill cbpaginator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill removes the repetitive and error-prone work of implementing server-side pagination in ColdBox/BoxLang applications, ensuring consistent page calculations, offsets, and API pagination metadata across handlers and views.

Core Features & Use Cases

  • Paginator service integration: Injection-ready Pagination service to create pagination objects and shorthand paginate() helper for quick usage.
  • QueryBuilder and QB support: Works with QB QueryBuilder to run count queries, apply limit/offset, and return pageable collections.
  • API and view support: Produces consistent pagination metadata for JSON APIs and renders page navigation for Bootstrap/Tailwind views.
  • Best-practice patterns: Encourages validating page/per_page, capping maxRows, clamping page ranges, and returning standardized { data: [], pagination: {} } responses.

Quick Start

Use cbpaginator to paginate a users listing and return a JSON response with data and pagination metadata based on rc.page and rc.perPage.

Frequently Asked Questions about cbpaginator

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

FAQPage Schema
How do I implement server-side pagination in a ColdBox REST API?▼

Server-side pagination in a ColdBox REST API is handled by applying a pagination service to listing handlers. This calculates offsets, page boundaries, and exposes metadata fields like total, current_page, and last_page within standardized JSON responses.

Can I use QueryBuilder with ColdBox to paginate database records?▼

Yes, QueryBuilder integrates with ColdBox pagination to run count queries and apply limit and offset clauses. This returns pageable collections directly from your database queries alongside calculated page metadata.

What is the best way to generate consistent pagination metadata for ColdBox applications?▼

Consistent pagination metadata is generated by using a dedicated pagination service that standardizes fields like total, per_page, current_page, last_page, from, and to. This ensures uniform API responses across different listing endpoints.

Does ColdBox pagination support Bootstrap view rendering for page navigation?▼

Yes, ColdBox pagination supports Bootstrap view rendering to display page navigation. It produces the necessary pagination metadata to render UI components for both Bootstrap and Tailwind views.

How do I validate page and per_page parameters to prevent pagination errors in ColdBox?▼

Validating page and per_page parameters in ColdBox involves capping maxRows and clamping page ranges to valid boundaries. This best-practice pattern prevents offset errors and ensures accurate pageable collection responses.

Why does my ColdBox API return inconsistent page calculations for large record sets?▼

Inconsistent page calculations usually occur when pagination logic is manually implemented. Injecting a dedicated pagination service standardizes offset calculations, total counts, and page boundaries across handlers to resolve these discrepancies.