Class: Button::IconComponent

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/spark/button/icon_component.rb

Instance Method Summary collapse

Instance Method Details

#before_renderObject



3
4
5
6
7
# File 'app/components/spark/button/icon_component.rb', line 3

def before_render
  aria_attr label: text
  add_class("theme-icon-only")
  super
end

#button_contentObject



11
12
13
# File 'app/components/spark/button/icon_component.rb', line 11

def button_content
  concat component("ui/icon", name: icon, class: join_class('icon')) if icon
end