Class: Flowbite::BreadcrumbItem

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/flowbite/breadcrumb_item.rb,
app/components/flowbite/breadcrumb_item/first.rb,
app/components/flowbite/breadcrumb_item/current.rb

Overview

Base class for rendering a breadcrumb item (middle items in the breadcrumb trail).

Examples:

Middle item

<%= render Flowbite::BreadcrumbItem.new(href: "/projects") { "Projects" } %>

Direct Known Subclasses

Current, First

Defined Under Namespace

Classes: Current, First

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(href:, **options) ⇒ BreadcrumbItem

Returns a new instance of BreadcrumbItem.



14
15
16
17
18
# File 'app/components/flowbite/breadcrumb_item.rb', line 14

def initialize(href:, **options)
  super()
  @href = href
  @options = options
end

Instance Attribute Details

#hrefObject (readonly)

Returns the value of attribute href.



12
13
14
# File 'app/components/flowbite/breadcrumb_item.rb', line 12

def href
  @href
end

#optionsObject (readonly)

Returns the value of attribute options.



12
13
14
# File 'app/components/flowbite/breadcrumb_item.rb', line 12

def options
  @options
end

Instance Method Details

#callObject



20
21
22
23
24
25
26
27
# File 'app/components/flowbite/breadcrumb_item.rb', line 20

def call
  (:li, item_options) do
    (:div, class: "flex items-center") do
      concat(render(prefix_icon)) if prefix_icon
      concat(render_link)
    end
  end
end