Method: Coco::Menu#button_kwargs

Defined in:
app/components/coco/buttons/menu/menu.rb

#button_kwargs(kwargs, type = nil) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'app/components/coco/buttons/menu/menu.rb', line 17

def button_kwargs(kwargs, type = nil)
  btn_kwargs = {
    theme: nil,
    size: get_option_value(:size),
    resize: args[:resize],
    **kwargs,
    fit: :full,
    collapsible: false
  }

  if type == :menu
    btn_kwargs[:toggle] = :horizontal
    btn_kwargs[:dropdown] ||= {
      placement: "right-start"
    }
  end

  btn_kwargs
end