Class: UI::TabsContentComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::TabsContentComponent
- Includes:
- TabsContentBehavior
- Defined in:
- app/view_components/ui/tabs_content_component.rb
Overview
TabsContent component (ViewComponent) Panel displaying content for active tab
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(value: "", default_value: "", orientation: "horizontal", classes: "", attributes: {}) ⇒ TabsContentComponent
constructor
A new instance of TabsContentComponent.
Methods included from TabsContentBehavior
#content_html_attributes, #content_state
Constructor Details
#initialize(value: "", default_value: "", orientation: "horizontal", classes: "", attributes: {}) ⇒ TabsContentComponent
Returns a new instance of TabsContentComponent.
18 19 20 21 22 23 24 |
# File 'app/view_components/ui/tabs_content_component.rb', line 18 def initialize(value: "", default_value: "", orientation: "horizontal", classes: "", attributes: {}) @value = value @default_value = default_value @orientation = orientation @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'app/view_components/ui/tabs_content_component.rb', line 26 def call attrs = content_html_attributes attrs[:data] = attrs[:data].merge(@attributes.fetch(:data, {})) content_tag :div, **attrs.merge(@attributes.except(:data)) do content end end |