rails-components

Create reusable Rails UI components with ERB templates and class-based helpers.

Updated Jun 9, 2026
One-click install
npx skills add https://github.com/arthun01/achados-uesc --skill rails-components-arthun01
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rails-components
Source: https://github.com/arthun01/achados-uesc/tree/main/.opencode/skills/rails-components
Command: npx skills add https://github.com/arthun01/achados-uesc --skill rails-components-arthun01

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires erb, tailwindcss, view_component, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill addresses the challenge of creating, organizing, and managing reusable UI components within a Rails application, streamlining the process of componentization.

Core Features & Use Cases

  • UI Component Creation: Develop and reuse partials, helpers, and layouts for Rails apps.
  • Partials and Templates: Generate ERB partials for common UI elements and class-based helpers for styling.
  • Layouts and Slot Management: Create structured layouts with nested views and slots for content insertion.
  • Use Case: If you're building a Rails application and need to create a series of buttons, modals, or other UI elements, this Skill will help you define and reuse these components across your app.

Quick Start

Generate a button component with class-based Tailwind helpers by running 'rails generate component Button variant:string size:string'.

Frequently Asked Questions about rails-components

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build reusable UI components in Rails with Tailwind CSS?

You can create reusable UI components in Rails by generating ERB partials, class-based helpers, and structured layouts with slots. This streamlines component organization and ensures consistent UI patterns across your application views.

How do I generate a button component with Tailwind classes in a Rails application?

You generate a button component by running 'rails generate component Button variant:string size:string'. This creates an ERB template with class-based Tailwind helpers for styling your reusable button UI elements.

Do I need Rails 8.1 to use ViewComponent for UI component creation?

Yes, a Rails 8.1+ environment is required for this UI component creation approach. You also need Tailwind CSS integration and ViewComponent dependencies installed to manage the ERB templates and layouts effectively.

What is the best way to manage layouts and nested views for Rails UI components?

The best way to manage layouts and nested views is by using structured layouts with slots for content insertion. This allows you to define reusable ERB partials and class-based helpers for consistent component styling.

Can I use this Rails component approach without Tailwind CSS integration?

No, Tailwind CSS integration is a required dependency for this component creation approach. The generated ERB templates and class-based helpers rely on Tailwind CSS to provide the styling for your UI components.