--- layout: layouts/page.njk title: Breadcrumb description: Displays the path to the current resource using a hierarchy of links. toc: - label: Usage id: usage --- {% from "macros/code_preview.njk" import code_preview %} {% from "macros/code_block.njk" import code_block %} {% from "dropdown-menu.njk" import dropdown_menu %}
{% lucide "circle-alert" %}

There is no dedicated breadcrumb component in Basecoat.

{% set code_script %} {% endset %} {% set code_html %}
  1. Home
  2. {% lucide "chevron-right", { "class": "size-3.5" } %}
  3. {% set trigger %} {% lucide "ellipsis" %} {% endset %} {% call dropdown_menu( id="demo-breadcrumb-menu", trigger=trigger, trigger_attrs={"class": "flex size-9 items-center justify-center h-4 w-4 hover:text-foreground cursor-pointer"}, register_on=["alpine:init", "htmx:afterSwap"] ) %} {% endcall %}
  4. {% lucide "chevron-right", { "class": "size-3.5" } %}
  5. Components
  6. {% lucide "chevron-right", { "class": "size-3.5" } %}
  7. Breadcrumb
{% endset %} {{ code_preview("dropdown-menu", code_script | prettyHtml ~ code_html | prettyHtml) }}

Usage

{% lucide "circle-alert" %}

This component requires Javascript.

This example uses some simple Tailwind CSS styles along with the Dropdown Menu.

You can include the Javascript code provided below, load it as an individual file or use the CLI. Some Alpine.js properties are also required on certain elements (e.g. x-bind, x-data, @click).

Components with Javascript {% lucide "arrow-right" %} Use the CLI {% lucide "arrow-right" %} Individual JS file (select.js) {% lucide "arrow-right" %}
{% from "tabs.njk" import tabs %} {% set tabsets = [ { tab: "HTML", panel: code_block(code_html | prettyHtml, class="") }, { tab: "Javascipt (Alpine.js)", panel: code_block(code_script | prettyHtml, class="") } ] %} {{ tabs(id="alert-dialog", tabsets=tabsets) }}