Class: PhlexKit::SidebarGroupAction

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

Overview

Action button pinned to the top-right of a SidebarGroup (the group is the positioning context), ported from shadcn/ui's SidebarGroupAction. See sidebar.rb.

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ SidebarGroupAction

Returns a new instance of SidebarGroupAction.



6
7
8
# File 'app/components/phlex_kit/sidebar/sidebar_group_action.rb', line 6

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

Instance Method Details

#view_template(&block) ⇒ Object



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

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