Class: PhlexKit::CardAction

Inherits:
BaseComponent show all
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

Methods inherited from BaseComponent

#on

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_templateObject



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