Class: UI::AlertDialogHeader

Inherits:
Phlex::HTML
  • Object
show all
Includes:
AlertDialogHeaderBehavior
Defined in:
app/components/ui/alert_dialog_header.rb

Overview

Header - Phlex implementation

Header section of the alert dialog. Uses AlertDialogHeaderBehavior module for shared styling logic.

Examples:

Basic usage

render UI::Header.new do
  render UI::Title.new { "Alert Title" }
end

Instance Method Summary collapse

Methods included from AlertDialogHeaderBehavior

#alert_dialog_header_base_classes, #alert_dialog_header_classes, #alert_dialog_header_html_attributes

Constructor Details

#initialize(classes: "", **attributes) ⇒ AlertDialogHeader

Returns a new instance of AlertDialogHeader.

Parameters:

  • classes (String) (defaults to: "")

    Additional CSS classes to merge

  • attributes (Hash)

    Additional HTML attributes



17
18
19
20
# File 'app/components/ui/alert_dialog_header.rb', line 17

def initialize(classes: "", **attributes)
  @classes = classes
  @attributes = attributes
end

Instance Method Details

#view_template(&block) ⇒ Object



22
23
24
25
26
# File 'app/components/ui/alert_dialog_header.rb', line 22

def view_template(&block)
  div(**alert_dialog_header_html_attributes) do
    yield if block_given?
  end
end