Class: UI::BreadcrumbList

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

Overview

List - Phlex implementation

Container for breadcrumb items, rendered as an ordered list. Uses BreadcrumbListBehavior concern for shared styling logic.

Examples:

Basic usage

render UI::List.new do
  render UI::Item.new { "Item content" }
end

Instance Method Summary collapse

Methods included from BreadcrumbListBehavior

#breadcrumb_list_classes, #breadcrumb_list_html_attributes

Constructor Details

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

Returns a new instance of BreadcrumbList.

Parameters:

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

    Additional CSS classes to merge

  • attributes (Hash)

    Additional HTML attributes



17
18
19
20
# File 'app/components/ui/breadcrumb_list.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/breadcrumb_list.rb', line 22

def view_template(&block)
  ol(**breadcrumb_list_html_attributes) do
    yield if block_given?
  end
end