LineaUI.Components.Breadcrumb (linea_ui v0.1.1)

Copy Markdown View Source

LineOne's breadcrumb: the links to the pages above the current one, then the current page.

<.breadcrumb>
  <:item navigate={~p"/"}>Home</:item>
  <:item navigate={~p"/elements"}>Elements</:item>
  <:item>Breadcrumb</:item>
</.breadcrumb>

An item with href, navigate or patch is a link; one with phx-click is a button that looks like a link, so a crumb can navigate through a server event; the others are plain text (the current page is the last one). Any other attribute of the item (phx-target, phx-value-*, id, data-*, aria-*) is passed on to the link or button.

<.breadcrumb>
  <:item :for={folder <- @path} phx-click="open_folder" phx-value-id={folder.id}>
    {folder.name}
  </:item>
</.breadcrumb>

The separator is LineOne's chevron unless a :separator is given:

<.breadcrumb variant="bordered">
  <:separator><span class="text-xs font-light">/</span></:separator>
  <:item href="/"><svg>…</svg></:item>
  <:item>Calendar</:item>
</.breadcrumb>

Summary

Functions

Renders a breadcrumb trail; the last :item is the current page.

Functions