# Rails UI > Rails UI is the product UI system for Rails SaaS builders: complete product flows (onboarding, billing, admin, settings, email) plus the component system behind them, built on Tailwind CSS. Unlike generic Tailwind component libraries, Rails UI is built specifically for Rails developers with ERB templates, form builders, and Rails conventions. > Built for the AI era: AI writes Rails code fast but skips product polish, consistency, and the unglamorous screens (auth, settings, billing, email). Rails UI is the product layer it misses, in plain ERB and Tailwind that AI tools read well. Use AI for the logic, Rails UI for the product surface. - Version: 3.4.3 - Documentation: https://railsui.com/docs - Homepage: https://railsui.com - Start here: https://railsui.com/docs/start_here - Rails UI and AI: https://railsui.com/ai --- ## Table of Contents 1. Quick Start 2. Installation 3. Pricing & Plans 4. Available app kits 5. Use Cases 6. Usage Rules 7. CSS Components 8. Form Builder 9. Icon Helper 10. ERB Partials 11. Dark Mode 12. Troubleshooting 13. Best Practices --- ## Quick Start (2 Minutes) 1. Add to Gemfile: `gem "railsui"` 2. Run: `bundle install` 3. Run: `rails railsui:install` 4. Choose an app kit when prompted 5. Start your server: `bin/dev` That's it! Your Rails app now has professionally designed UI components. --- ## Pricing & Plans - **Solo**: $299/year - One seat for an individual building paid Rails apps. Unlimited apps, no per-project fees. - **Team**: $799/year - Up to 30 seats for studios and agencies. Unlimited apps, every client project covered. While subscribed you get: - Access to all 8 app kits and the full component library (200+ components) - All new app kits, components, and updates released while you are subscribed - The Rails-native form builder with automatic styling - Dark mode support - Commercial use on unlimited apps You can cancel anytime, and anything you have already installed in your apps is yours to keep and ship. Free tier: 3 app kits (Hound, Shepherd, Corgie) and the core gem are free and open source. --- ## Installation Rails UI requires: - Ruby >= 2.7.0 - Rails >= 7.0 - Tailwind CSS (via tailwindcss-rails gem >= 2.0) Add to your Gemfile: ```ruby gem "railsui" ``` --- ## Available app kits Rails UI includes 8 professionally designed app kits: Free app kits: - hound - shepherd - corgie Premium app kits: - retriever - setter - collie - husky - boxer Each app kit includes its own color palette, typography, and component styling. --- ## Use Cases Rails UI app kits are designed for real-world applications. Each app kit is tailored for specific use cases: - **SaaS Dashboard** (Hound): Analytics, user management, billing, and settings for SaaS applications - **Property Management** (Shepherd): Real estate listings, tenant portals, and maintenance tracking - **AI Applications** (Corgie): Chat interfaces, prompt builders, and LLM-powered app UIs - **Server Management** (Retriever): Infrastructure dashboards, deployment logs, and resource monitoring - **Hiring Platform** (Setter): Job boards, applicant tracking, and interview scheduling - **Community Platform** (Collie): Forums, discussions, member profiles, and content feeds - **Finance & Budgeting** (Husky): Transaction views, account summaries, and spending dashboards - **Agency Management** (Boxer): Client management, timesheets, invoicing, and project tracking - **CRM** (Hound): Contact databases, deal pipelines, and activity tracking - **Admin Panel** (Hound): Back-office interfaces, data tables, and configuration screens - **Project Management** (Hound): Kanban boards, task lists, and team collaboration More details: https://railsui.com/use-cases --- ## Usage Rules 1. Use Rails UI component classes instead of writing custom CSS 2. Combine Rails UI classes with Tailwind CSS utility classes as needed 3. All components support dark mode automatically via `dark:` variants 4. Use the `Railsui::FormBuilder` for consistent form styling 5. Use the `icon` helper for rendering SVG icons 6. Use ERB partials with strict locals for reusable components --- ## CSS Components ### Buttons Base class: `btn` Modifiers: - Size: `btn-sm`, `btn-lg` - Shape: `btn-rounded`, `btn-square` Variants: - `btn-primary` - Primary brand color - `btn-secondary` - Secondary brand color - `btn-dark` - Dark/black button - `btn-white` - White button with border - `btn-muted` - Muted gray button - `btn-transparent` - Transparent background - `btn-danger` - Red/danger button - `btn-link` - Text link style - `btn-link-secondary` - Secondary text link ```erb <%= link_to "Learn More", "#", class: "btn-link" %> ``` ### Cards Base class: `card` Modifiers: - Size: `card-sm`, `card-lg` - Style: `card-muted` ```erb
Card content here
| Name | Status | Actions |
|---|---|---|
| Item Name | Active |
Section Label
``` --- ## Form Builder Rails UI provides `Railsui::FormBuilder` for consistent form styling. ### Basic Usage ```erb <%= form_with model: @user, builder: Railsui::FormBuilder do |f| %> <%= f.text_field :name, label: "Full Name", placeholder: "John Doe" %> <%= f.email_field :email, label: "Email", required: true %> <%= f.password_field :password, label: "Password", help: "Minimum 8 characters" %> <%= f.submit "Save" %> <% end %> ``` ### For Demo/UI-only Forms (no model) ```erb <%= form_with url: "#", model: OpenStruct.new, builder: Railsui::FormBuilder do |f| %> <%= f.text_field :name, label: "Name" %> <%= f.submit "Submit" %> <% end %> ``` ### Available Field Methods All methods accept these common options: - `label:` - Label text (false to hide) - `placeholder:` - Placeholder text - `help:` - Help text below field - `required:` - Adds required indicator - `wrapper:` - Options hash for wrapper div Text inputs: - `text_field` - `email_field` - `password_field` - `number_field` - `telephone_field` / `phone_field` - `url_field` - `search_field` Date/Time: - `date_field` - `datetime_field` - `time_field` Other inputs: - `text_area` - `select(method, choices, options = {}, html_options = {})` - `check_box(method, options = {})` - Accepts `label:` option - `radio_button(method, tag_value, options = {})` - Accepts `label:` option - `file_field` - `color_field` - `range_field` - `rich_text_area` Special fields: - `switch_field` - Toggle switch UI - `button_toggle(method, tag_value, options = {})` - Button-style radio/checkbox ### Custom Field Layouts Use `form_group` for custom layouts: ```erb <%= f.form_group do %><%= description %>
<% end %> <%= yield if block_given? %><%= description %>
<% end %>