Class: Spina::UserInterface::TabLinkComponent
- Inherits:
-
ApplicationComponent
- Object
- ViewComponent::Base
- ApplicationComponent
- Spina::UserInterface::TabLinkComponent
- Defined in:
- app/components/spina/user_interface/tab_link_component.rb
Instance Method Summary collapse
- #css_classes ⇒ Object
-
#initialize(name = nil, url = nil, active: false) ⇒ TabLinkComponent
constructor
A new instance of TabLinkComponent.
Constructor Details
#initialize(name = nil, url = nil, active: false) ⇒ TabLinkComponent
Returns a new instance of TabLinkComponent.
4 5 6 7 8 9 |
# File 'app/components/spina/user_interface/tab_link_component.rb', line 4 def initialize(name = nil, url = nil, active: false) url = name if url.nil? @url = url @name = name @active = active end |
Instance Method Details
#css_classes ⇒ Object
11 12 13 14 15 16 17 |
# File 'app/components/spina/user_interface/tab_link_component.rb', line 11 def css_classes if @active "cursor-default text-gray-900 bg-spina-dark bg-opacity-10" else "" end end |