Class: Uchi::Flowbite::Card
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Uchi::Flowbite::Card
- Defined in:
- app/components/uchi/flowbite/card.rb,
app/components/uchi/flowbite/card/title.rb
Overview
Renders a card element.
Defined Under Namespace
Classes: Title
Class Method Summary collapse
- .classes(state: :default, style: :default) ⇒ Object
-
.styles ⇒ Object
rubocop:disable Layout/LineLength.
Instance Method Summary collapse
-
#initialize(class: [], options: {}, title: {}) ⇒ Card
constructor
A new instance of Card.
Constructor Details
#initialize(class: [], options: {}, title: {}) ⇒ Card
Returns a new instance of Card.
41 42 43 44 45 |
# File 'app/components/uchi/flowbite/card.rb', line 41 def initialize(class: [], options: {}, title: {}) @class = Array(binding.local_variable_get(:class)) || [] = || {} @title = title end |
Class Method Details
.classes(state: :default, style: :default) ⇒ Object
11 12 13 14 |
# File 'app/components/uchi/flowbite/card.rb', line 11 def classes(state: :default, style: :default) style = styles.fetch(style) style.fetch(state) end |
.styles ⇒ Object
rubocop:disable Layout/LineLength
17 18 19 20 21 22 23 |
# File 'app/components/uchi/flowbite/card.rb', line 17 def styles { default: Uchi::Flowbite::Style.new( default: ["p-6", "bg-neutral-primary-soft", "border", "border-default", "rounded-base", "shadow-xs"] ) }.freeze end |