Class: LightningUiKit::Breadcrumb::ItemComponent
- Inherits:
-
LightningUiKit::BaseComponent
- Object
- LightningUiKit::BaseComponent
- LightningUiKit::Breadcrumb::ItemComponent
- Defined in:
- app/components/lightning_ui_kit/breadcrumb/item_component.rb
Instance Attribute Summary collapse
-
#href ⇒ Object
readonly
Returns the value of attribute href.
Instance Method Summary collapse
- #current_classes ⇒ Object
-
#initialize(href: nil, current: false, **options) ⇒ ItemComponent
constructor
A new instance of ItemComponent.
- #link? ⇒ Boolean
- #link_classes ⇒ Object
Constructor Details
#initialize(href: nil, current: false, **options) ⇒ ItemComponent
Returns a new instance of ItemComponent.
2 3 4 5 6 |
# File 'app/components/lightning_ui_kit/breadcrumb/item_component.rb', line 2 def initialize(href: nil, current: false, **) @href = href @current = current @options = end |
Instance Attribute Details
#href ⇒ Object (readonly)
Returns the value of attribute href.
26 27 28 |
# File 'app/components/lightning_ui_kit/breadcrumb/item_component.rb', line 26 def href @href end |
Instance Method Details
#current_classes ⇒ Object
19 20 21 22 23 24 |
# File 'app/components/lightning_ui_kit/breadcrumb/item_component.rb', line 19 def current_classes merge_classes([ "lui:font-normal lui:text-foreground", @options[:class] ].compact.join(" ")) end |
#link? ⇒ Boolean
8 9 10 |
# File 'app/components/lightning_ui_kit/breadcrumb/item_component.rb', line 8 def link? !@current && @href.present? end |
#link_classes ⇒ Object
12 13 14 15 16 17 |
# File 'app/components/lightning_ui_kit/breadcrumb/item_component.rb', line 12 def link_classes merge_classes([ "lui:transition-colors lui:hover:text-foreground", @options[:class] ].compact.join(" ")) end |