Class: Flowbite::Breadcrumb

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/flowbite/breadcrumb.rb

Overview

Renders a breadcrumb navigation component.

See flowbite.com/docs/components/breadcrumb/

Examples:

Basic usage with BreadcrumbItem components

<%= render Flowbite::Breadcrumb.new do |breadcrumb| %>
  <% breadcrumb.with_item do %>
    <%= render Flowbite::BreadcrumbItem::First.new(href: "/") { "Home" } %>
  <% end %>
  <% breadcrumb.with_item do %>
    <%= render Flowbite::BreadcrumbItem.new(href: "/projects") { "Projects" } %>
  <% end %>
  <% breadcrumb.with_item do %>
    <%= render Flowbite::BreadcrumbItem::Current.new { "Current Page" } %>
  <% end %>
<% end %>

Instance Method Summary collapse

Instance Method Details

#callObject



23
24
25
26
27
28
29
30
31
# File 'app/components/flowbite/breadcrumb.rb', line 23

def call
  (:nav, class: "flex", "aria-label": "Breadcrumb") do
    (:ol, class: "inline-flex items-center space-x-1 md:space-x-2 rtl:space-x-reverse") do
      items.each do |item|
        concat(item)
      end
    end
  end
end