Class: UI::HoverCardContentComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::HoverCardContentComponent
- Includes:
- HoverCardContentBehavior
- Defined in:
- app/view_components/ui/hover_card_content_component.rb
Overview
ContentComponent - ViewComponent implementation
The content that appears on hover. Uses HoverCardContentBehavior for shared styling logic.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(align: "center", side_offset: 4, classes: "", **attributes) ⇒ HoverCardContentComponent
constructor
A new instance of HoverCardContentComponent.
Methods included from HoverCardContentBehavior
#content_classes, #content_data_attributes, #content_html_attributes
Constructor Details
#initialize(align: "center", side_offset: 4, classes: "", **attributes) ⇒ HoverCardContentComponent
Returns a new instance of HoverCardContentComponent.
22 23 24 25 26 27 |
# File 'app/view_components/ui/hover_card_content_component.rb', line 22 def initialize(align: "center", side_offset: 4, classes: "", **attributes) @align = align @side_offset = side_offset @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
29 30 31 32 33 34 35 |
# File 'app/view_components/ui/hover_card_content_component.rb', line 29 def call attrs = content_html_attributes content_tag :div, **attrs.merge(@attributes) do content end end |