Class: Railsboot::DropdownComponent

Inherits:
Component
  • Object
show all
Defined in:
app/components/railsboot/dropdown_component.rb

Overview

ViewComponent: renders the dropdown block.

Instance Method Summary collapse

Constructor Details

#initialize(**html_attributes) ⇒ DropdownComponent

Returns a new instance of DropdownComponent.

Parameters:

  • html_attributes (Hash)

    additional HTML attributes applied to the rendered element

Options Hash (**html_attributes):

  • :class (String)

    additional CSS classes, merged with the component's own classes



14
15
16
17
18
19
20
21
# File 'app/components/railsboot/dropdown_component.rb', line 14

def initialize(**html_attributes)
  @html_attributes = html_attributes

  @html_attributes[:class] = class_names(
    "dropdown",
    html_attributes.delete(:class)
  )
end