class UiBibz::Ui::Core::Notifications::Components::AlertHeader

Create a alert body

Attributes

Options

You can add HTML attributes using the html_options. You can pass arguments in options attribute:

Signatures

UiBibz::Ui::Core::Notifications::AlertHeader.new(content, options = nil, html_options = nil)

UiBibz::Ui::Core::Notifications::AlertHeader.new(options = nil, html_options = nil) do
  content
end

Examples

UiBibz::Ui::Core::Notifications::AlertHeader.new.render

UiBibz::Ui::Core::Notifications::AlertHeader.new do
  'Exemple'
end.render

Public Instance Methods

pre_render() click to toggle source

See UiBibz::Ui::Core::Component.initialize

# File lib/ui_bibz/ui/core/notifications/components/alert_header.rb, line 36
def pre_render
  if options[:tap] == false
    html_content
  else
    content_tag :h4, html_content, html_options
  end
end

Private Instance Methods

close_html() click to toggle source
# File lib/ui_bibz/ui/core/notifications/components/alert_header.rb, line 56
def close_html
  content_tag :button, '', type: 'button', class: 'btn-close', 'data-bs-dismiss' => 'alert', 'aria-label' => 'Close'
end
component_html_classes() click to toggle source
# File lib/ui_bibz/ui/core/notifications/components/alert_header.rb, line 46
def component_html_classes
  'alert-header'
end
html_content() click to toggle source
# File lib/ui_bibz/ui/core/notifications/components/alert_header.rb, line 50
def html_content
  output = [glyph_and_content_html]
  output << close_html if options[:closable]
  output.join.html_safe
end