Class: PhlexKit::Breadcrumb
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::Breadcrumb
- Defined in:
- app/components/phlex_kit/breadcrumb/breadcrumb.rb
Overview
Navigational hierarchy trail. Ported from ruby_ui's RubyUI::Breadcrumb. Compose Breadcrumb > BreadcrumbList > BreadcrumbItem (+ Link/Page/Separator/Ellipsis).
Instance Method Summary collapse
-
#initialize(**attrs) ⇒ Breadcrumb
constructor
A new instance of Breadcrumb.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(**attrs) ⇒ Breadcrumb
Returns a new instance of Breadcrumb.
5 |
# File 'app/components/phlex_kit/breadcrumb/breadcrumb.rb', line 5 def initialize(**attrs) = (@attrs = attrs) |
Instance Method Details
#view_template ⇒ Object
7 8 9 10 11 12 13 |
# File 'app/components/phlex_kit/breadcrumb/breadcrumb.rb', line 7 def view_template(&) base = { class: "pk-breadcrumb" } # Default only when the caller didn't supply their own accessible name # (localization, two breadcrumbs on a page) — `mix` would fuse them. base[:aria] = { label: "breadcrumb" } unless aria_labelled? nav(**mix(base, @attrs), &) end |