Class: PhlexKit::InlineLink
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::InlineLink
- 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
-
#initialize(href:, **attrs) ⇒ InlineLink
constructor
A new instance of InlineLink.
- #view_template(&block) ⇒ Object
Methods inherited from BaseComponent
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 |