Method: Primer::Alpha::Dropdown#initialize

Defined in:
app/components/primer/alpha/dropdown.rb

#initialize(overlay: :default, with_caret: false, **system_arguments) ⇒ Dropdown

Returns a new instance of Dropdown.

Parameters:

  • overlay (Symbol) (defaults to: :default)

    <%= one_of(Primer::Beta::Details::OVERLAY_MAPPINGS.keys) %>

  • with_caret (Boolean) (defaults to: false)

    Whether or not a caret should be rendered in the button.

  • system_arguments (Hash)

    <%= link_to_system_arguments_docs %>

[View source]

40
41
42
43
44
45
46
47
48
49
50
# File 'app/components/primer/alpha/dropdown.rb', line 40

def initialize(overlay: :default, with_caret: false, **system_arguments)
  @with_caret = with_caret

  @system_arguments = system_arguments
  @system_arguments[:overlay] = overlay
  @system_arguments[:reset] = true
  @system_arguments[:classes] = class_names(
    @system_arguments[:classes],
    "dropdown"
  )
end