Cinder.Renderers.Pagination (Cinder v0.12.1)

Copy Markdown View Source

Shared pagination component used by Table, List, and Grid renderers.

Supports two pagination modes:

Uses AshPhoenix.LiveView helpers for working with Ash.Page structs directly.

Summary

Functions

Renders pagination controls with page navigation and optional page size selector.

Checks if pagination controls should be shown based on page.

Functions

render(assigns)

Renders pagination controls with page navigation and optional page size selector.

Handles the wrapper div and conditional display internally. Returns empty content if pagination should not be shown.

Required assigns

  • page - An Ash.Page.Offset, Ash.Page.Keyset, or nil
  • page_size_config - Map with page size configuration
  • theme - Theme configuration map
  • myself - LiveComponent reference for event targeting
  • show_pagination - Boolean to enable/disable pagination (default: true)

show_pagination?(_)

Checks if pagination controls should be shown based on page.

Returns true if there are more results than fit on one page.