Class: UI::DrawerDescriptionComponent

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

Overview

Drawer description component (ViewComponent) ARIA-compliant description for drawer

Examples:

<%= render UI::DescriptionComponent.new { "Drawer description text" } %>

Instance Method Summary collapse

Methods included from DrawerDescriptionBehavior

#drawer_description_base_classes, #drawer_description_classes, #drawer_description_html_attributes

Constructor Details

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

Returns a new instance of DrawerDescriptionComponent.

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_description_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_description_component.rb', line 18

def call
   :p, content, **drawer_description_html_attributes.merge(@attributes)
end