Darksea UI is a collection of reusable UI components for Rails applications, styled with Tailwind CSS.
Add this line to your application's Gemfile:
ruby gem 'darksea-ui', github: 'your-username/ui'
And then execute:
$ bundle install
Include the helpers in your ApplicationController:
ruby class ApplicationController < ActionController::Base helper UI::ComponentHelpers end
Now you can use the components in your views:
erb <%= Button(variant: :primary) do %> Click me <% end %>
Or with the full namespace: erb <%= render(UI::ButtonComponent.new(variant: :primary)) do %> Click me <% end %>
- Button
- Card
You can customize the appearance of components by adjusting your Tailwind CSS configuration.
After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.
Bug reports and pull requests are welcome on GitHub at https://github.com/your-username/ui.
The gem is available as open source under the terms of the MIT License.