Class: RubyUIAdmin::Views::CardComponent
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- RubyUIAdmin::Views::CardComponent
- Includes:
- UI
- Defined in:
- app/components/ruby_ui_admin/views/card_component.rb
Overview
Renders a single dashboard card, dispatching on the card type.
Instance Method Summary collapse
-
#initialize(card:) ⇒ CardComponent
constructor
A new instance of CardComponent.
- #view_template ⇒ Object
Constructor Details
#initialize(card:) ⇒ CardComponent
Returns a new instance of CardComponent.
9 10 11 |
# File 'app/components/ruby_ui_admin/views/card_component.rb', line 9 def initialize(card:) @card = card end |
Instance Method Details
#view_template ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'app/components/ruby_ui_admin/views/card_component.rb', line 13 def view_template render RubyUI::Card.new(class: span_class) do render RubyUI::CardHeader.new do render RubyUI::CardTitle.new(class: "text-sm font-medium text-muted-foreground") { @card.label } end render RubyUI::CardContent.new do render_body end end end |