A scope-based, customizable paginator for Ruby web apps supporting multiple ORMs and template engines.
Kaminari is a pagination library for Ruby web applications that splits large datasets into pages using a scope-based API. It solves the problem of efficiently navigating and displaying large collections of records in web apps, providing a clean and customizable interface without polluting core Ruby classes. It works with multiple ORMs (like ActiveRecord and Mongoid) and web frameworks (like Rails and Sinatra).
Ruby developers building web applications with Rails, Sinatra, or Grape who need to paginate database queries or arrays. It's especially useful for teams using multiple ORMs or template engines and wanting a unified pagination approach.
Developers choose Kaminari for its non-intrusive design, framework agnosticism, and extensive customization options. Its scope-based API aligns with modern Ruby practices, and its support for various ORMs and template engines makes it versatile for diverse tech stacks.
⚡ A Scope & Engine based, clean, powerful, customizable and sophisticated paginator for Ruby webapps
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Kaminari uses method chaining on ActiveRecord::Relation without globally polluting core Ruby classes like Array or Hash, keeping the codebase clean as emphasized in the 'Clean' section of the README.
It supports multiple ORMs (ActiveRecord, Mongoid, DataMapper) and web frameworks (Rails, Sinatra, Grape), making it versatile for diverse tech stacks, as detailed under 'ORM & Template Engine Agnostic'.
Developers can override partial templates via a theme system and use generators to create custom views, allowing deep UI adjustments per the 'Customizing the Pagination Helper' section.
The library outputs HTML5 <nav> tags by default and supports Rails unobtrusive Ajax, aligning with contemporary web practices as noted in the 'Modern' feature description.
Kaminari does not automatically add an order to queries, so developers must include it to avoid unpredictable pagination results, a caveat explicitly warned in the 'Query Basics' section.
Ajax support depends on rails-ujs, which is deprecated in Rails 7.2 and beyond, making it less suitable for modern Rails applications without additional workarounds, as mentioned in the 'Ajax Links' note.
Creating or modifying pagination templates requires running generators and editing partials manually, adding steps compared to libraries with inline configuration or pre-styled components.