Class: Panda::Core::UI::Card
- Defined in:
- app/components/panda/core/UI/card.rb
Overview
Card component for containing related content.
Cards are flexible containers that can hold any content, with optional padding, shadows, and border variations.
Constant Summary
Constants inherited from Base
Instance Attribute Summary collapse
-
#border ⇒ Object
readonly
Returns the value of attribute border.
-
#elevation ⇒ Object
readonly
Returns the value of attribute elevation.
-
#padding ⇒ Object
readonly
Returns the value of attribute padding.
Instance Method Summary collapse
- #default_attrs ⇒ Object
-
#initialize(padding: :medium, elevation: :low, border: true, **attrs) ⇒ Card
constructor
A new instance of Card.
Constructor Details
#initialize(padding: :medium, elevation: :low, border: true, **attrs) ⇒ Card
Returns a new instance of Card.
32 33 34 35 36 37 |
# File 'app/components/panda/core/UI/card.rb', line 32 def initialize(padding: :medium, elevation: :low, border: true, **attrs) @padding = padding @elevation = elevation @border = border super(**attrs) end |
Instance Attribute Details
#border ⇒ Object (readonly)
Returns the value of attribute border.
39 40 41 |
# File 'app/components/panda/core/UI/card.rb', line 39 def border @border end |
#elevation ⇒ Object (readonly)
Returns the value of attribute elevation.
39 40 41 |
# File 'app/components/panda/core/UI/card.rb', line 39 def elevation @elevation end |
#padding ⇒ Object (readonly)
Returns the value of attribute padding.
39 40 41 |
# File 'app/components/panda/core/UI/card.rb', line 39 def padding @padding end |
Instance Method Details
#default_attrs ⇒ Object
41 42 43 44 45 |
# File 'app/components/panda/core/UI/card.rb', line 41 def default_attrs { class: card_classes } end |