Class: Flowbite::Card::Title
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Flowbite::Card::Title
- Defined in:
- app/components/flowbite/card/title.rb
Overview
Renders the title of a card element.
Class Method Summary collapse
- .classes(state: :default, style: :default) ⇒ Object
-
.styles ⇒ Object
rubocop:disable Layout/LineLength.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(**options) ⇒ Title
constructor
A new instance of Title.
Constructor Details
#initialize(**options) ⇒ Title
Returns a new instance of Title.
34 35 36 |
# File 'app/components/flowbite/card/title.rb', line 34 def initialize(**) = || {} end |
Class Method Details
.classes(state: :default, style: :default) ⇒ Object
8 9 10 11 |
# File 'app/components/flowbite/card/title.rb', line 8 def classes(state: :default, style: :default) style = styles.fetch(style) style.fetch(state) end |
.styles ⇒ Object
rubocop:disable Layout/LineLength
14 15 16 17 18 19 20 21 22 |
# File 'app/components/flowbite/card/title.rb', line 14 def styles Flowbite::Styles.from_hash( { default: { default: ["mb-2", "text-2xl", "font-semibold", "tracking-tight", "text-heading"] } }.freeze ) end |
Instance Method Details
#call ⇒ Object
26 27 28 29 30 31 32 |
# File 'app/components/flowbite/card/title.rb', line 26 def call = { class: self.class.classes }.merge() content_tag(:h5, content, **) end |