Class: Shadcn::CardTitleComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Shadcn::CardTitleComponent
- Defined in:
- app/components/shadcn/card_title_component.rb
Overview
Card Title component
Constant Summary collapse
- BASE_CLASSES =
"font-semibold leading-none tracking-tight"
Instance Attribute Summary
Attributes inherited from BaseComponent
#class_name, #data, #html_options
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(tag: :h3, **options, &block) ⇒ CardTitleComponent
constructor
A new instance of CardTitleComponent.
Methods inherited from BaseComponent
Methods included from Rails::Helpers::ClassNameHelper
Constructor Details
#initialize(tag: :h3, **options, &block) ⇒ CardTitleComponent
Returns a new instance of CardTitleComponent.
9 10 11 12 |
# File 'app/components/shadcn/card_title_component.rb', line 9 def initialize(tag: :h3, **, &block) super(**, &block) @tag = tag end |
Instance Method Details
#call ⇒ Object
14 15 16 |
# File 'app/components/shadcn/card_title_component.rb', line 14 def call content_tag(@tag, content, class: merge_classes(BASE_CLASSES), **) end |