Class: PhlexKit::Sidebar

Inherits:
BaseComponent show all
Defined in:
app/components/phlex_kit/sidebar/sidebar.rb

Overview

Sidebar shell, ported from ruby_ui's RubyUI::Sidebar at collapsible: :none (the NonCollapsibleSidebar path): a static flex-column rail. Deliberately WITHOUT ruby_ui's collapsible/offcanvas Stimulus controller + cookie state + mobile Sheet (the admin sidebar is static) — those can be added later if a collapsible chrome is wanted. Compose with SidebarWrapper (the page root) + SidebarHeader / SidebarContent / SidebarMenu (+ Item / Button) / SidebarFooter, alongside a SidebarInset for the main content. Tailwind → vanilla .pk-sidebar* (sidebar.css).

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ Sidebar

Returns a new instance of Sidebar.



11
12
13
# File 'app/components/phlex_kit/sidebar/sidebar.rb', line 11

def initialize(**attrs)
  @attrs = attrs
end

Instance Method Details

#view_template(&block) ⇒ Object



15
16
17
# File 'app/components/phlex_kit/sidebar/sidebar.rb', line 15

def view_template(&block)
  div(**mix({ class: "pk-sidebar" }, @attrs), &block)
end