Class: FComponents::Button::Component
- Inherits:
-
FComponents::Base
- Object
- ViewComponent::Base
- FComponents::Base
- FComponents::Button::Component
- Defined in:
- app/components/f_components/button/component.rb
Constant Summary collapse
- TYPE_CLASSES =
{ primary: 'bt--primary', secondary: 'bt--primary bt--outlined', tertiary: 'bt--tertiary', custom: '' }.freeze
- MODIFIERS =
{ success: 'bt--success', secondary: 'bt--secondary', error: 'bt--error', white: 'bt--white', warning: 'bt--warning', fit: 'w--fit max-w--fit', full: 'bt--full', outlined: 'bt--outlined', small: 'bt--smr', large: 'bt--lg', centered: 'mx--auto' }.freeze
- MODS =
MODIFIERS.to_h.deep_dup
Instance Attribute Summary collapse
-
#href ⇒ Object
readonly
Returns the value of attribute href.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(title, href = nil, **options) ⇒ Component
constructor
A new instance of Component.
Methods inherited from FComponents::Base
Methods included from ComponentsHelper
Constructor Details
#initialize(title, href = nil, **options) ⇒ Component
Returns a new instance of Component.
32 33 34 35 36 37 38 39 40 41 |
# File 'app/components/f_components/button/component.rb', line 32 def initialize(title, href = nil, **) @title = title @href = href || 'javascript: void(0);' @modifiers = .delete(:mods) @type = .delete(:type) || :primary @tag = .delete(:tag) || :a @class = .delete(:class) || '' @left_icon = .delete(:left_icon) @options = end |
Instance Attribute Details
#href ⇒ Object (readonly)
Returns the value of attribute href.
30 31 32 |
# File 'app/components/f_components/button/component.rb', line 30 def href @href end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
30 31 32 |
# File 'app/components/f_components/button/component.rb', line 30 def @options end |