Class: PhlexKit::CardAction
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::CardAction
- Defined in:
- app/components/phlex_kit/card/card_action.rb
Overview
Top-right slot of a CardHeader (a button, link or badge) — the header becomes a 1fr/auto grid when present. Ported from shadcn/ui's CardAction (newer than ruby_ui's card). See card.rb.
Instance Method Summary collapse
-
#initialize(**attrs) ⇒ CardAction
constructor
A new instance of CardAction.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(**attrs) ⇒ CardAction
Returns a new instance of CardAction.
6 7 8 |
# File 'app/components/phlex_kit/card/card_action.rb', line 6 def initialize(**attrs) @attrs = attrs end |
Instance Method Details
#view_template ⇒ Object
10 11 12 |
# File 'app/components/phlex_kit/card/card_action.rb', line 10 def view_template(&) div(**mix({ class: "pk-card-action" }, @attrs), &) end |