Class: Spina::UserInterface::TabLinkComponent

Inherits:
ApplicationComponent show all
Defined in:
app/components/spina/user_interface/tab_link_component.rb

Instance Method Summary collapse

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_classesObject



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