A Rails project with ViewComponents to build modular and maintainable user interfaces. This repository provides a foundation for creating web applications with reusable design patterns.
- ViewComponents: Build reusable UI components with encapsulated logic and templates.
- Modular System: Add and customize components easily to suit your application's needs.
-
Clone this repository:
git clone https://github.com/pierre-jezegou/rails-design-system.git cd rails-design-system
-
Install Ruby dependencies:
bundle install
-
Start the development server:
bin/rails server
Visit your application at http://localhost:3000. The Lookbook web interface is at http://localhost:3000/lookbook
Add new components in the app/components
directory. Example:
-
Generate a component:
bin/rails generate component Navigation
-
Define the component's behavior in
app/components/navigation_component.rb
and its template inapp/components/navigation_component.html.erb
or directly in component definition witherb_template
-
Use the component in views:
<%= render(NavigationComponent.new(title: "My Navigation")) %>
This project is licensed under the ???.