Class: Shadcn::CardContentComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Shadcn::CardContentComponent
- Defined in:
- app/components/shadcn/card_content_component.rb
Overview
Card Content component
Constant Summary collapse
- BASE_CLASSES =
"p-6"
Instance Attribute Summary
Attributes inherited from BaseComponent
#class_name, #data, #html_options
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(standalone: false, **options, &block) ⇒ CardContentComponent
constructor
A new instance of CardContentComponent.
Methods inherited from BaseComponent
Methods included from Rails::Helpers::ClassNameHelper
Constructor Details
#initialize(standalone: false, **options, &block) ⇒ CardContentComponent
Returns a new instance of CardContentComponent.
9 10 11 12 |
# File 'app/components/shadcn/card_content_component.rb', line 9 def initialize(standalone: false, **, &block) super(**, &block) @standalone = standalone end |
Instance Method Details
#call ⇒ Object
14 15 16 17 |
# File 'app/components/shadcn/card_content_component.rb', line 14 def call classes = @standalone ? BASE_CLASSES : "#{BASE_CLASSES} pt-0" content_tag(:div, content, class: merge_classes(classes), **) end |