Class: Components::Button

Inherits:
Base
  • Object
show all
Defined in:
lib/backpack/components/button.rb

Constant Summary collapse

Radius =
_Union(:none, :small, :full)

Constants included from Backpack::Attributes

Backpack::Attributes::HTMLAttribute, Backpack::Attributes::HTMLAttributes, Backpack::Attributes::MandatoryHTMLAttribute

Instance Method Summary collapse

Methods included from Backpack::Classes

#root_classes

Methods included from Backpack::Identifier

#identifier

Instance Method Details

#view_template(&block) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/backpack/components/button.rb', line 12

def view_template(&block)
  if href?
    a(href: @href, **root_attributes, &block)
  else
    button(**root_attributes, &block)
  end
end