Theo Rails screenshot

Theo Rails

Author Avatar Theme by Loomchild
Updated: 17 Jan 2026
28 Stars

Theo is a small and elegant HTML-like template language for Ruby on Rails, featuring more natural partials and computed attributes.

Categories

Overview

Theo is an innovative HTML-like template language specifically designed for Ruby on Rails, making it easier to construct server-rendered user interfaces. In a world where developers are accustomed to frameworks like Vue.js or React, Eric Barlow’s Theo tackles the limitations of the existing ERB syntax, offering a more intuitive approach to organizing partials and computed attributes. While still experimental, Theo opens up new possibilities and simplifies the coding experience for Rails developers.

With Theo, the frustration of context-switching between HTML and Ruby is greatly reduced. The language allows for seamless integration of partials using a straightforward syntax, making the development process more fluid and accessible for those familiar with component-based architectures.

Features

  • Elegant Syntax: Theo simplifies partial rendering using a clean HTML-like syntax, allowing developers to focus on structure rather than complicated Ruby code.

  • Computed Attributes: Enhance your components effortlessly using computed attributes with the %= syntax, preventing conflicts with HTML tags.

  • Short Form Dynamic Attributes: If a dynamic attribute matches its name, it can be simplified and omitted, streamlining the markup even further.

  • Boolean HTML Attributes: Theo smartly handles boolean attributes by including or omitting them based on their truthiness, ensuring cleaner and more meaningful markup.

  • Intuitive Partials Management: Render partials using a familiar _<partial-name> pattern, or opt for PascalCase, making it easy to visualize your UI structure.

  • Flexible Special Attributes: Dynamic special attributes prefixed with % provide advanced customization options, enhancing functionality and adaptability.

  • Collections Support: Render collections of partials with the %collection attribute for efficient and elegant batch processing of UI components.

  • Compatibility with Various Template Languages: Theo allows for partial rendering across ERB, Theo, or any supported template language, ensuring versatility in your application.