Class: PhlexKit::InlineLink

Inherits:
BaseComponent show all
Defined in:
app/components/phlex_kit/typography/inline_link.rb

Overview

Inline text link, ported from ruby_ui's RubyUI::InlineLink — a brand-coloured underline-on-hover <a> for links inside prose (vs PhlexKit::Link, which is the button-styled link family). href: required; attrs pass through via mix.

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(href:, **attrs) ⇒ InlineLink

Returns a new instance of InlineLink.



6
7
8
9
# File 'app/components/phlex_kit/typography/inline_link.rb', line 6

def initialize(href:, **attrs)
  @href = href
  @attrs = attrs
end

Instance Method Details

#view_template(&block) ⇒ Object



11
12
13
# File 'app/components/phlex_kit/typography/inline_link.rb', line 11

def view_template(&block)
  a(**mix({ href: @href, class: "pk-inline-link" }, @attrs), &block)
end