Pagination

Table (gem footer pager) Cards (kaminari default pager)
How this page is built the gem renders it — this is all you write

Pagination works in a custom layout too. You still paginate in the controller (kaminari); the cards layout feeds collection.page_scope to kaminari's own paginate helper, so the pager below is kaminari's default markup — styling it is your job, as always with kaminari.

app/controllers/books_controller.rb
@query = CrudComponents::Query.new(Book, params, fieldset: :index, ability: current_ability)
@books = @query.apply(Book.all).page(params[:page]).per(8)   # kaminari
app/views/crud_components/layouts/_cards.html.erb
<%= paginate collection.page_scope %>   <%# kaminari's own pager, inside your card layout %>
app/views/pagination/index.html.erb
<%= crud_collection @books, query: @query, layout: :cards %>

Read more: Pagination  ·  Add a layout

The Endless Empire 41
Author names
Kim Robinson and Ted Chiang
Genre
Scifi
Price
30.81 €
Publisher
Active
The Broken Machine 42
Author names
Ted Chiang
Genre
Nonfiction
Price
25.55 €
Publisher
Ace
Active
The Broken Empire 43
Author names
Ursula Le Guin
Genre
Fiction
Price
20.31 €
Publisher
Del Rey
Active
The Ancient Ocean 44
Author names
Becky Chambers
Genre
Nonfiction
Price
25.72 €
Publisher
Vintage
Active
The Luminous City 45
Author names
Kim Robinson, Stanisław Lem, and Ann Leckie
Genre
Scifi
Price
40.14 €
Publisher
Vintage
Active
The Broken Engine 46
Author names
Ted Chiang and Octavia Butler
Genre
Scifi
Price
5.74 €
Publisher
DAW
Active
The Endless Station 47
Author names
Joe Abercrombie and Kim Robinson
Genre
Fiction
Price
26.37 €
Publisher
Tor Books
Active
The Hidden Mirror 48
Author names
Adrian Tchaikovsky
Genre
Scifi
Price
21.19 €
Publisher
Tor Books
Active