Skip to content

Add LaravelPaginator component and Gooey plugin#42

Merged
stevethomas merged 8 commits intomainfrom
steve/pagination
Mar 12, 2026
Merged

Add LaravelPaginator component and Gooey plugin#42
stevethomas merged 8 commits intomainfrom
steve/pagination

Conversation

@stevethomas
Copy link
Member

@stevethomas stevethomas commented Mar 12, 2026

Summary

  • Adds LaravelPaginator component that auto-detects LengthAwarePaginator vs CursorPaginator responses and renders appropriate navigation
  • Introduces gooey Vue plugin so consumers configure their framework's link component once (Link for Inertia, NuxtLink for Nuxt) — falls back to plain <a> tags if not configured
  • Adds GooeyLink internal component, CursorPaginatorResponse<T> global type, showcase page with docs, and Cypress smoke tests
  • Adds plugin setup docs to Installation page (Inertia + Nuxt examples)

Anything the reviewer needs to know

  • Fully backwards compatible — no plugin setup required. Existing apps continue working with <a> tag fallback.
  • The gooey plugin and GooeyOptions type are exported from the library entry point for consumer setup.
  • GooeyLink is intentionally NOT exported — internal implementation detail only.
  • Paginator<T> and CursorPaginatorResponse<T> types are globally declared — no import needed for consumers.
  • LengthAwarePaginator has responsive layout: chevron prev/next on mobile, full numbered pagination with "Showing X to Y of Z" on desktop.
  • Laravel's links array prev/next entries are skipped by index (first/last) to avoid HTML entity matching issues.

🤖 Generated with Claude Code

stevethomas and others added 8 commits March 12, 2026 11:04
Introduces a server-driven pagination component for Laravel apps that
auto-detects LengthAwarePaginator vs CursorPaginator responses. Adds a
createGooey() plugin so consumers can configure their framework's link
component (Inertia Link, NuxtLink, etc.) once at app setup — falls back
to plain <a> tags for backwards compatibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Description section, props table, framework setup examples for both
Inertia and Nuxt, and improved code samples with type annotations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Laravel's links array always has prev/next as first/last entries with
HTML entities in labels. Skip by index instead of string matching.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@stevethomas stevethomas merged commit 20a0618 into main Mar 12, 2026
2 checks passed
@stevethomas stevethomas deleted the steve/pagination branch March 12, 2026 04:19
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.

1 participant