Class: Coco::Link

Inherits:
Component
  • Object
show all
Includes:
Concerns::ActsAsLink, Concerns::Extendable, Concerns::WithIcon
Defined in:
app/components/coco/base/link/link.rb

Direct Known Subclasses

App::Elements::Link

Instance Method Summary collapse

Methods included from Concerns::AcceptsOptions

#accepted_options, #get_option_group

Methods included from Concerns::ActsAsLink

#link_text

Instance Method Details

#call ⇒ Object



7
8
9
10
11
12
13
14
# File 'app/components/coco/base/link/link.rb', line 7

def call
  render component_tag(class: ["coco-link", ("with-icon" if icon?)]) do
    safe_join([
      icon,
      icon? ? tag.span(link_text, class: "link-text") : link_text
    ])
  end
end