Class: Shadcn::CollapsibleContentComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Shadcn::CollapsibleContentComponent
- Defined in:
- app/components/shadcn/collapsible_content_component.rb
Overview
Collapsible Content component
Constant Summary collapse
- BASE_CLASSES =
"overflow-hidden data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down"
Instance Attribute Summary
Attributes inherited from BaseComponent
#class_name, #data, #html_options
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(open: false, **options, &block) ⇒ CollapsibleContentComponent
constructor
A new instance of CollapsibleContentComponent.
Methods inherited from BaseComponent
Methods included from Rails::Helpers::ClassNameHelper
Constructor Details
#initialize(open: false, **options, &block) ⇒ CollapsibleContentComponent
Returns a new instance of CollapsibleContentComponent.
8 9 10 11 |
# File 'app/components/shadcn/collapsible_content_component.rb', line 8 def initialize(open: false, **, &block) super(**, &block) @open = open end |
Instance Method Details
#call ⇒ Object
13 14 15 |
# File 'app/components/shadcn/collapsible_content_component.rb', line 13 def call content_tag(:div, content, content_attributes) end |