Class: Playbook::PbButton::Button

Inherits:
Object
  • Object
show all
Includes:
Playbook::Props
Defined in:
app/pb_kits/playbook/pb_button/button.rb

Instance Method Summary collapse

Methods included from Playbook::Props

#dark_props, #generate_classname, #generate_classname_without_spacing, #initialize, #prop, #spacing_options, #spacing_props, #spacing_values

Instance Method Details



38
39
40
41
42
43
# File 'app/pb_kits/playbook/pb_button/button.rb', line 38

def link_options
  options.merge(
    href: link,
    target: new_window ? "_blank" : "_self"
  )
end

#optionsObject



26
27
28
29
30
31
32
33
34
35
36
# File 'app/pb_kits/playbook/pb_button/button.rb', line 26

def options
  {
    id: id,
    data: data,
    class: classname,
    disabled: disabled,
    aria: aria,
    type: type,
    value: value,
  }.compact
end

#tagObject



45
46
47
# File 'app/pb_kits/playbook/pb_button/button.rb', line 45

def tag
  link ? "a" : "button"
end