Class: Fluxbit::BreadcrumbComponent

Inherits:
Component
  • Object
show all
Includes:
Config::BreadcrumbComponent
Defined in:
app/components/fluxbit/breadcrumb_component.rb

Overview

The ‘Fluxbit::BreadcrumbComponent` renders a breadcrumb navigation following Flowbite styles. It uses slots for items, allowing each breadcrumb item to have an optional icon and a current_page flag.

Defined Under Namespace

Classes: Item

Instance Method Summary collapse

Methods inherited from Component

#add, #add_popover_or_tooltip, #anyicon, #element_name, #fx_id, #icon, #options, #popover?, #random_id, #remove_class, #remove_class_from_props, #render_popover_or_tooltip, #target, #tooltip?

Methods included from IconHelpers

#chevron_double_left, #chevron_double_right, #chevron_down, #chevron_left, #chevron_right, #chevron_up, #close_icon, #ellipsis_horizontal, #eye_icon, #eye_slash_icon, #plus_icon

Constructor Details

#initialize(**props) ⇒ BreadcrumbComponent

Initialize with any HTML attributes (e.g., custom class or aria-label for the <nav>)



16
17
18
19
20
# File 'app/components/fluxbit/breadcrumb_component.rb', line 16

def initialize(**props)
  super
  @props = props
  @props["aria-label"] ||= "Breadcrumb"
end

Instance Method Details

#callObject



22
23
24
25
26
# File 'app/components/fluxbit/breadcrumb_component.rb', line 22

def call
  tag.nav(**@props) do
    tag.ol(safe_join(items), class: styles[:root][:list])
  end
end