Breadcrumb(ui_breadcrumb)
UiBibz::Ui::Core::Navigations::Breadcrumb
Indicate the current page's location within a navigational hierarchy.
Usage
This component is an extension of component element. A Ui Bibz component consists of 3 arguments:
ui_breadcrumb options, html_options do |b|
# by variable
b.link content, options, html_options
# or by block
b.link options, html_options do
content
end
end
# or
ui_breadcrumb store, options, html_options
Examples
Some examples explain how to use the options present in the component.Breadcrumb
ui_breadcrumb do |b|
b.link "Home", current: true
end
ui_breadcrumb do |b|
b.link "Home", url: "#home"
b.link "Library", current: true
end
ui_breadcrumb divider: ">" do |b|
b.link "Home", url: "#home"
b.link "Library", url: "#library"
b.link "Data", current: true
end
<nav arial-label="breadcrumb">
<ol class="breadcrumb">
<li class="active breadcrumb-item" aria-current="page">Home</li>
</ol>
</nav>
<nav arial-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#home">Home</a></li>
<li class="active breadcrumb-item" aria-current="page">Library</li>
</ol>
</nav>
<nav arial-label="breadcrumb" style="--bs-breadcrumb-divider: '>';">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#active">Home</a></li>
<li class="breadcrumb-item"><a href="#library">Library</a></li>
<li class="active breadcrumb-item" aria-current="page">Data</li>
</ol>
</nav>
Breadcrumb with store
Options are :
Option link_url
can be written:
- "/user/:id"
- user_path(:id)
ui_breadcrumb store: @users, link_label: :email, link_url: "\#/id/edit"
<ol class="breadcrumb">
<li><a href="#/1/edit">test0@test.com</a></li>
<li><a href="#/2/edit">test1@test.com</a></li>
<li aria-current="page">test2@test.com</li>
</ol>