Skip to content

harshumaretiya/tailview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

37 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TailView UI - Rails Component Library

Rails Version Ruby Version Tailwind CSS License

A comprehensive collection of modern, production-ready UI components built with Rails, Tailwind CSS, and Stimulus. Perfect for developers who want beautiful, accessible components without the complexity of heavy JavaScript frameworks.

✨ Features

🎨 20+ Production-Ready Components

  • Basic Components: Buttons, Badges, Avatars
  • Layout Components: Cards, Breadcrumbs, Tabs, Accordions
  • Interactive Components: Alerts, Modals, Popovers, Toasts
  • Data Components: Tables with sorting/filtering, Progress bars
  • Form Components: Inputs, Selects, Checkboxes, Validation states
  • Navigation Components: Breadcrumbs, Pagination

πŸš€ Modern Rails Stack

  • Rails 8.0.2 with latest features
  • ViewComponent for clean, testable components
  • Tailwind CSS for utility-first styling
  • Stimulus for lightweight JavaScript interactions
  • Turbo for seamless page updates
  • Solid Queue/Cache/Cable for production infrastructure

🎯 Developer Experience

  • Copy-paste ready code snippets
  • Interactive examples with live demos
  • Comprehensive documentation for each component
  • Responsive design out of the box
  • Accessibility compliant components
  • TypeScript-ready Stimulus controllers

πŸ”§ Production Ready

  • Docker support with optimized Dockerfile
  • Kamal deployment configuration
  • Security headers and CSRF protection
  • Performance optimized with caching
  • Health checks and monitoring ready

πŸš€ Quick Start

Prerequisites

  • Ruby 3.4.1 or higher
  • Rails 8.0 or higher
  • Node.js 18+ (for Tailwind CSS)
  • SQLite3

Installation

  1. Clone the repository
git clone https://github.com/yourusername/tailview-ui.git
cd tailview-ui
  1. Install dependencies
bundle install
npm install
  1. Setup the database
rails db:create
rails db:migrate
  1. Start the development server
rails server
  1. Visit the application Open http://localhost:3000 in your browser

πŸ“š Usage

Using Components in Your Rails App

1. Copy Individual Components

<!-- Copy this button code into your Rails view -->
<button class="bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors">
  Click me
</button>

2. Using ViewComponents

<!-- In your view -->
<%= render AlertComponent.new(
  variant: :success,
  title: "Success!",
  message: "Your action was completed successfully.",
  dismissible: true
) %>

3. With Stimulus Controllers

<!-- Add interactivity -->
<div data-controller="alert" data-alert-auto-dismiss-value="5000">
  <%= render AlertComponent.new(variant: :info, message: "Auto-dismissing alert") %>
</div>

Available Components

Component Description Example
Buttons Various button styles and states View Examples
Alerts Success, error, warning, info notifications View Examples
Cards Content containers with headers/footers View Examples
Tables Data tables with sorting and filtering View Examples
Modals Overlay dialogs and popups View Examples
Forms Input fields and form controls View Examples
Tabs Tabbed content organization View Examples
Accordions Collapsible content sections View Examples
Badges Status indicators and labels View Examples
Avatars User profile images and initials View Examples
Toasts Toast notifications and messages View Examples
Popovers Contextual tooltips and hints View Examples
Breadcrumbs Navigation breadcrumb trails View Examples

🎨 Customization

Tailwind Configuration

The project uses Tailwind CSS with a custom configuration. You can modify config/tailwind.config.js to customize colors, spacing, and other design tokens.

Component Customization

All components are built with ViewComponent, making them easy to customize:

# app/components/custom_button_component.rb
class CustomButtonComponent < ButtonComponent
  def initialize(variant: :primary, **options)
    super(variant: variant, **options)
  end

  private

  def button_classes
    # Override default classes
    "custom-button #{super}"
  end
end

Color Themes

Components support multiple color variants:

  • Primary: Blue theme
  • Success: Green theme
  • Warning: Yellow theme
  • Error: Red theme
  • Info: Blue theme
  • Neutral: Gray theme

πŸ§ͺ Testing

Running Tests

# Run all tests
rails test

# Run specific test files
rails test test/components/alert_component_test.rb

# Run with coverage
COVERAGE=true rails test

Test Coverage

  • Component Tests: Comprehensive test coverage for all ViewComponents
  • Controller Tests: Full test coverage for all controllers
  • Integration Tests: End-to-end testing for user workflows
  • System Tests: Browser-based testing with Capybara

πŸš€ Deployment

Docker Deployment

# Build the image
docker build -t tailview-ui .

# Run the container
docker run -d -p 80:80 -e RAILS_MASTER_KEY=<your-key> tailview-ui

Kamal Deployment

# Deploy to production
kamal deploy

# Deploy with specific environment
kamal deploy -d production

Environment Variables

# Required for production
RAILS_MASTER_KEY=your_master_key
RAILS_ENV=production

# Optional
RAILS_LOG_LEVEL=info
WEB_CONCURRENCY=2
JOB_CONCURRENCY=3

πŸ“– Documentation

🀝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Setup

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes
  4. Add tests for your changes
  5. Run the test suite: rails test
  6. Commit your changes: git commit -m 'Add amazing feature'
  7. Push to the branch: git push origin feature/amazing-feature
  8. Open a Pull Request

Code Style

  • Follow Rails conventions
  • Use RuboCop for code formatting
  • Write tests for new features
  • Update documentation as needed

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Rails Team for the amazing framework
  • Tailwind CSS for the utility-first CSS framework
  • Hotwire for Stimulus and Turbo
  • ViewComponent for component architecture
  • Contributors who help make this project better

πŸ“ž Support

🌟 Star History

Star History Chart


Built with ❀️ using Rails, Tailwind CSS, and Stimulus

GitHub β€’ Documentation β€’ Twitter

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published