Class: Anchor::LinkComponent
- Defined in:
- app/components/anchor/link_component.rb
Constant Summary collapse
- VARIANT_DEFAULT =
:accent
- VARIANT_MAPPINGS =
{ VARIANT_DEFAULT => "text-accent hover:text-accent-hover", :secondary => "text-secondary hover:text-primary", }.freeze
- VARIANT_OPTIONS =
VARIANT_MAPPINGS.keys
Constants included from ViewHelper
Instance Attribute Summary collapse
-
#href ⇒ Object
readonly
Returns the value of attribute href.
Instance Method Summary collapse
-
#initialize(href:, **kwargs) ⇒ LinkComponent
constructor
A new instance of LinkComponent.
- #render? ⇒ Boolean
Methods inherited from Component
Methods included from ViewHelper
#anchor_form_with, #anchor_svg, #deep_blank?, #merge_options, #popover_trigger_attributes
Methods included from FetchOrFallbackHelper
Constructor Details
#initialize(href:, **kwargs) ⇒ LinkComponent
Returns a new instance of LinkComponent.
10 11 12 13 14 |
# File 'app/components/anchor/link_component.rb', line 10 def initialize(href:, **kwargs) @href = href super(**kwargs) end |
Instance Attribute Details
#href ⇒ Object (readonly)
Returns the value of attribute href.
16 17 18 |
# File 'app/components/anchor/link_component.rb', line 16 def href @href end |
Instance Method Details
#render? ⇒ Boolean
18 19 20 |
# File 'app/components/anchor/link_component.rb', line 18 def render? content? end |