Class: UI::AlertTitle

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

Overview

Alert Title - Phlex implementation

Title text for an alert component.

Examples:

render UI::Title.new { "Important Notice" }

Instance Method Summary collapse

Methods included from AlertTitleBehavior

#alert_title_base_classes, #alert_title_classes, #alert_title_html_attributes, #render_alert_title

Constructor Details

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

Returns a new instance of AlertTitle.

Parameters:

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

    Additional CSS classes to merge

  • attributes (Hash)

    Additional HTML attributes



14
15
16
17
# File 'app/components/ui/alert_title.rb', line 14

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

Instance Method Details

#view_template(&block) ⇒ Object



19
20
21
22
23
# File 'app/components/ui/alert_title.rb', line 19

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