# `LedgerUI.Components.Breadcrumb`
[🔗](https://github.com/devaction-labs/ledger_ui/blob/v0.2.0/lib/ledger_ui/components/breadcrumb.ex#L1)

The trail of pages above the current one; the last `:item` is the current page.

    <.breadcrumb>
      <:item navigate={~p"/customers"}>Customers</:item>
      <:item>Casa das Tintas</:item>
    </.breadcrumb>

An item with `href`, `navigate` or `patch` is a link; one with `phx-click` is a link-looking
button; the others are plain text. `nil`/`false` destinations count as absent. Any other attr
of the item (`phx-target`, `phx-value-*`, `id`, `data-*`, `aria-*`) goes to the link.

`max_items` collapses a long trail: it keeps the first step and the last `max_items - 2`, and
the ones in between become a "…" button opening a `dropdown/1` (id `"#{id}-more"`).

The last step is rendered with `aria-current="page"`; the "…" trigger is a `role="button"`
with `aria-label`, `aria-haspopup`, `aria-expanded` and `aria-controls` (from `dropdown/1`).

`variant` is `canvas`, `plain` or `bordered`. The default is `nil`: the base `lu-crumb` look,
which is the canvas one without the extra pill classes. The `:separator` slot replaces the
default `/`.

Additions to the README: the item attr `icon` (an icon drawn before the step, outside the
link) and `style` (on the current step, or on a span wrapping a link and its separator, for
staggered animations).

# `breadcrumb`

## Attributes

* `variant` (`:string`) - Defaults to `nil`.Must be one of `nil`, `"canvas"`, `"plain"`, or `"bordered"`.
* `label` (`:string`) - Defaults to `"Breadcrumb"`.
* `max_items` (`:integer`) - Defaults to `nil`.
* `more_label` (`:string`) - Defaults to `"Show hidden steps"`.
* `id` (`:string`) - Defaults to `nil`.
* `class` (`:any`) - Defaults to `nil`.
* Global attributes are accepted.
## Slots

* `item` (required) - Accepts attributes:

  * `href` (`:string`)
  * `navigate` (`:string`)
  * `patch` (`:string`)
  * `class` (`:any`)
  * `icon` (`:string`)
  * `style` (`:string`)
  * `title` (`:string`)
  * `id` (`:string`)
  * `phx-click` (`:any`)
  * `phx-target` (`:any`)
  * `phx-value-id` (`:any`)
* `separator`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
