Class: PhlexKit::AlertAction

Inherits:
BaseComponent show all
Defined in:
app/components/phlex_kit/alert/alert_action.rb

Overview

Top-right action slot of a PhlexKit::Alert, ported from shadcn/ui's AlertAction. Pins its content (typically a small Button) to the alert's corner; the alert reserves right padding via :has(). See alert.rb.

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ AlertAction

Returns a new instance of AlertAction.



6
7
8
# File 'app/components/phlex_kit/alert/alert_action.rb', line 6

def initialize(**attrs)
  @attrs = attrs
end

Instance Method Details

#view_template(&block) ⇒ Object



10
11
12
# File 'app/components/phlex_kit/alert/alert_action.rb', line 10

def view_template(&block)
  div(**mix({ class: "pk-alert-action" }, @attrs), &block)
end