Class: UI::DrawerHeaderComponent

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

Overview

Drawer header component (ViewComponent) Header section for drawer

Examples:

<%= render UI::HeaderComponent.new do %>
  <%= render UI::TitleComponent.new { "Title" } %>
  <%= render UI::DescriptionComponent.new { "Description" } %>
<% end %>

Instance Method Summary collapse

Methods included from DrawerHeaderBehavior

#drawer_header_base_classes, #drawer_header_classes, #drawer_header_html_attributes

Constructor Details

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

Returns a new instance of DrawerHeaderComponent.

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_header_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_header_component.rb', line 21

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