Class: PhlexKit::SidebarRail
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::SidebarRail
- Defined in:
- app/components/phlex_kit/sidebar/sidebar_rail.rb
Overview
Invisible grab strip along the sidebar's trailing edge — clicking it toggles the collapse, like shadcn/ui's SidebarRail. Place it as the last child of a Sidebar inside a collapsible wrapper. See sidebar.rb.
Instance Method Summary collapse
-
#initialize(**attrs) ⇒ SidebarRail
constructor
A new instance of SidebarRail.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(**attrs) ⇒ SidebarRail
Returns a new instance of SidebarRail.
6 7 8 |
# File 'app/components/phlex_kit/sidebar/sidebar_rail.rb', line 6 def initialize(**attrs) @attrs = attrs end |
Instance Method Details
#view_template ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'app/components/phlex_kit/sidebar/sidebar_rail.rb', line 10 def view_template (**mix({ type: :button, class: "pk-sidebar-rail", aria_label: "Toggle sidebar", tabindex: "-1", title: "Toggle sidebar", data: { action: "click->phlex-kit--sidebar#toggle" } }, @attrs)) end |