Class: PhlexKit::AlertAction
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::AlertAction
- 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
-
#initialize(**attrs) ⇒ AlertAction
constructor
A new instance of AlertAction.
- #view_template(&block) ⇒ Object
Methods inherited from BaseComponent
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 |