Class: UI::DrawerTitleComponent

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

Overview

Drawer title component (ViewComponent) ARIA-compliant heading for drawer

Examples:

<%= render UI::TitleComponent.new { "Drawer Title" } %>

Instance Method Summary collapse

Methods included from DrawerTitleBehavior

#drawer_title_base_classes, #drawer_title_classes, #drawer_title_html_attributes

Constructor Details

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

Returns a new instance of DrawerTitleComponent.

Parameters:

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

    additional CSS classes

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

    additional HTML attributes



13
14
15
16
# File 'app/view_components/ui/drawer_title_component.rb', line 13

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

Instance Method Details

#callObject



18
19
20
# File 'app/view_components/ui/drawer_title_component.rb', line 18

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