Class: Keystone::Ui::BottomNavItemComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Keystone::Ui::BottomNavItemComponent
- Defined in:
- app/components/keystone/ui/bottom_nav_item_component.rb
Constant Summary collapse
- ITEM_BASE =
"bottom-nav-item"- ACTIVE_CLASS =
"active"- LABEL_CLASSES =
"bottom-nav-label"
Instance Attribute Summary collapse
-
#href ⇒ Object
readonly
Returns the value of attribute href.
-
#icon ⇒ Object
readonly
Returns the value of attribute icon.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
Instance Method Summary collapse
-
#initialize(label:, href:, icon:, active: false) ⇒ BottomNavItemComponent
constructor
A new instance of BottomNavItemComponent.
- #item_classes ⇒ Object
Constructor Details
#initialize(label:, href:, icon:, active: false) ⇒ BottomNavItemComponent
Returns a new instance of BottomNavItemComponent.
8 9 10 11 12 13 |
# File 'app/components/keystone/ui/bottom_nav_item_component.rb', line 8 def initialize(label:, href:, icon:, active: false) @label = label @href = href @icon = icon @active = active end |
Instance Attribute Details
#href ⇒ Object (readonly)
Returns the value of attribute href.
6 7 8 |
# File 'app/components/keystone/ui/bottom_nav_item_component.rb', line 6 def href @href end |
#icon ⇒ Object (readonly)
Returns the value of attribute icon.
6 7 8 |
# File 'app/components/keystone/ui/bottom_nav_item_component.rb', line 6 def icon @icon end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
6 7 8 |
# File 'app/components/keystone/ui/bottom_nav_item_component.rb', line 6 def label @label end |
Instance Method Details
#item_classes ⇒ Object
19 20 21 |
# File 'app/components/keystone/ui/bottom_nav_item_component.rb', line 19 def item_classes @active ? "#{ITEM_BASE} #{ACTIVE_CLASS}" : ITEM_BASE end |