Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Ruby
  3. Cells

Cells

Ruby

A view component library for Ruby and Rails that encapsulates UI into reusable, testable view models.

Visit WebsiteGitHubGitHub
3.1k stars237 forks0 contributors

What is Cells?

Cells is a view component library for Ruby and Rails that encapsulates UI into reusable view models. It solves the problem of tangled view logic by moving presentation code into Ruby classes, making components testable, maintainable, and composable. It integrates with the Trailblazer framework and supports various template engines like ERB, Haml, and Slim.

Target Audience

Ruby and Rails developers building complex UIs who need reusable, testable components, especially those using or interested in the Trailblazer architecture. It's ideal for teams prioritizing clean separation of concerns and object-oriented design in their views.

Value Proposition

Developers choose Cells for its object-oriented approach to views, enabling encapsulation, easy testing, and reuse without the limitations of Rails helpers. Its integration with Trailblazer, caching, and asset packaging makes it a robust solution for building scalable UI components.

Overview

View components for Ruby and Rails.

Use Cases

Best For

  • Encapsulating UI logic into reusable Ruby classes in Rails applications
  • Building testable view components with isolated rendering logic
  • Implementing complex, nested UI compositions with clean separation
  • Adding view caching with dynamic keys and expiration policies
  • Creating self-contained widgets with bundled JavaScript and CSS assets
  • Adopting the Trailblazer architecture for view layer organization

Not Ideal For

  • Teams heavily reliant on Rails' built-in helpers and partials who prefer minimal abstraction
  • Projects not using the Trailblazer framework, as full features and documentation are tied to it
  • Applications with simple, static views where the overhead of cell classes isn't justified
  • Environments where rapid prototyping with conventional Rails MVC is prioritized over long-term component architecture

Pros & Cons

Pros

Object-Oriented Encapsulation

Encapsulates UI logic in Ruby classes, promoting clean separation of concerns and reusable components, as evidenced by the view model approach that replaces Rails helpers.

Easy Testing Integration

Components render to plain HTML, allowing seamless testing with RSpec, MiniTest, or other frameworks, with a consistent API between production and test environments.

Built-in Caching Flexibility

Offers caching per state with configurable expiration and dynamic keys, enabling performance optimizations for frequently rendered components without extra gems.

Asset Packaging for Widgets

Supports bundling JavaScript, CSS, and images with cells, creating self-contained widgets that integrate with Rails' asset pipeline for encapsulation.

Cons

Complex Template Engine Setup

Requires separate gems for ERB, Haml, or Slim templates (e.g., cells-erb) and manual inclusion in non-Rails environments, adding dependency management overhead.

Steep Trailblazer Learning Curve

Deep integration with Trailblazer means developers must learn an additional framework for advanced features, with documentation centered around that ecosystem.

Performance Overhead from Abstraction

The object-oriented layer introduces slight overhead compared to raw Rails views, though caching mitigates this; instantiation and method calls add complexity.

Frequently Asked Questions

Quick Stats

Stars3,076
Forks237
Contributors0
Open Issues38
Last commit1 year ago
CreatedSince 2008

Tags

#trailblazer#rails#object-oriented-design#caching#frontend-architecture#testing#ui-components#view-components#ruby

Built With

R
Rails
R
Ruby
E
ERB
S
Slim
H
Haml

Links & Resources

Website

Included in

Ruby14.1k
Auto-fetched 17 hours ago

Related Projects

ViewComponentViewComponent

A framework for building reusable, testable & encapsulated view components in Ruby on Rails.

Stars3,565
Forks487
Last commit1 day ago
PhlexPhlex

Object-oriented views in Ruby.

Stars1,518
Forks106
Last commit10 days ago
KomponentKomponent

An opinionated way of organizing front-end code in Ruby on Rails, based on components

Stars422
Forks32
Last commit1 year ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub