Class: Shadcn::CollapsibleContentComponent

Inherits:
BaseComponent
  • Object
show all
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

Methods inherited from BaseComponent

#content

Methods included from Rails::Helpers::ClassNameHelper

#cn

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, **options, &block)
  super(**options, &block)
  @open = open
end

Instance Method Details

#callObject



13
14
15
# File 'app/components/shadcn/collapsible_content_component.rb', line 13

def call
  (:div, content, content_attributes)
end