Class: UI::EmptyHeader

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

Overview

EmptyHeader - Phlex implementation

Wraps the empty media, title, and description.

Examples:

render UI::EmptyHeader.new do
  render UI::EmptyMedia.new(variant: "icon") { icon }
  render UI::EmptyTitle.new { "No results" }
  render UI::EmptyDescription.new { "Try adjusting your search." }
end

Instance Method Summary collapse

Methods included from EmptyHeaderBehavior

#empty_header_classes, #empty_header_html_attributes

Constructor Details

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

Returns a new instance of EmptyHeader.



16
17
18
19
# File 'app/components/ui/empty_header.rb', line 16

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

Instance Method Details

#view_template(&block) ⇒ Object



21
22
23
# File 'app/components/ui/empty_header.rb', line 21

def view_template(&block)
  div(**empty_header_html_attributes.merge(@attributes), &block)
end