Write beautiful code with Phlex Kits

Class functions automatically initialize and render Phlex components

class Page < ApplicationComponent
  include Phlex::Kit

  def view_template
    Sidebar {
      Header { "My Site" }
      p(class: "text-lg font-bold") { "Let's mix components with some HTML tags." }
      TailwindNav title: "Site Menu" do |it|
        it.item("/") { "Home" }
        it.item("/about") { "About" }
        it.item("/contact") { "Contact" }
      end
    }
  end
end
11 / 39