ODT-UI for Ruby on Rails
Native Ruby on Rails integration for ODT-Lightweight-UI. Fast, accessible, and zero JavaScript runtime overhead for UI components.
Installation
Add to your Gemfile:
gem "odt-ui-rails", "~> 2.0.0"
Run bundle:
bundle install
bin/rails g odt:install
Or add CSS manually in app/assets/stylesheets/application.css:
@import "odt_ui.css";
Usage
Buttons
<%= odt_button "Click me", variant: :filled, color: :primary, radius: :full %>
<%= odt_button "New Schedule", href: new_event_path, icon: "fa-solid fa-plus" %>
Badges
<%= odt_badge "Active", variant: :subtle, color: :success %>
<%= odt_badge "Date", icon: "fa-regular fa-calendar" %>
Cards & Layout
<%= odt_card title: "Profile", subtitle: "User settings" do %>
<p>Card content</p>
<% end %>
Typography & Alerts
<%= odt_heading "Welcome", as: :h1 %>
<%= odt_text "Description here", color: :muted %>
<%= odt_alert "Saved successfully!", variant: :success %>
<%= odt_avatar name: "John Doe", size: :md %>