Class: UI::DrawerFooterComponent

Inherits:
ViewComponent::Base
  • Object
show all
Includes:
DrawerFooterBehavior
Defined in:
app/view_components/ui/drawer_footer_component.rb

Overview

Drawer footer component (ViewComponent) Action area for drawer (buttons, etc.)

Examples:

<%= render UI::FooterComponent.new do %>
  <%= render UI::ButtonComponent.new { "Submit" } %>
  <%= render UI::CloseComponent.new { "Cancel" } %>
<% end %>

Instance Method Summary collapse

Methods included from DrawerFooterBehavior

#drawer_footer_base_classes, #drawer_footer_classes, #drawer_footer_html_attributes

Constructor Details

#initialize(classes: "", attributes: {}) ⇒ DrawerFooterComponent

Returns a new instance of DrawerFooterComponent.

Parameters:

  • classes (String) (defaults to: "")

    additional CSS classes

  • attributes (Hash) (defaults to: {})

    additional HTML attributes



16
17
18
19
# File 'app/view_components/ui/drawer_footer_component.rb', line 16

def initialize(classes: "", attributes: {})
  @classes = classes
  @attributes = attributes
end

Instance Method Details

#callObject



21
22
23
# File 'app/view_components/ui/drawer_footer_component.rb', line 21

def call
   :div, content, **drawer_footer_html_attributes.merge(@attributes)
end