mirror of
https://github.com/hunvreus/basecoat.git
synced 2026-11-13 13:48:28 +00:00
69 lines
2.4 KiB
Plaintext
69 lines
2.4 KiB
Plaintext
---
|
|
layout: layouts/component.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 "components/dropdown-menu.njk" import dropdown_menu %}
|
|
|
|
<div class="alert mb-6">
|
|
{% lucide "circle-alert" %}
|
|
<h2>There is no dedicated breadcrumb component in Basecoat.</h2>
|
|
</div>
|
|
|
|
{% set code_script %}{% include "components/dropdown-menu-script.njk" %}{% endset %}
|
|
{% set code_html %}<ol class="text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5">
|
|
<li class="inline-flex items-center gap-1.5">
|
|
<a href="#" class="hover:text-foreground transition-colors">Home</a>
|
|
</li>
|
|
<li>{% lucide "chevron-right", { "class": "size-3.5" } %}</li>
|
|
<li class="inline-flex items-center gap-1.5">
|
|
{% 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"]
|
|
) %}
|
|
<nav role="menu">
|
|
<button type="button" role="menuitem">Documentation</button>
|
|
<button type="button" role="menuitem">Themes</button>
|
|
<button type="button" role="menuitem">GitHub</button>
|
|
</nav>
|
|
{% endcall %}
|
|
</li>
|
|
<li>{% lucide "chevron-right", { "class": "size-3.5" } %}</li>
|
|
<li class="inline-flex items-center gap-1.5">
|
|
<a href="#" class="hover:text-foreground transition-colors">Components</a>
|
|
</li>
|
|
<li>{% lucide "chevron-right", { "class": "size-3.5" } %}</li>
|
|
<li class="inline-flex items-center gap-1.5">
|
|
<span class="text-foreground font-normal">Breadcrumb</span>
|
|
</li>
|
|
</ol>{% endset %}
|
|
{{ code_preview("dropdown-menu", code_script ~ code_html | prettyHtml) }}
|
|
|
|
<h2 id="usage"><a href="#usage">Usage</a></h2>
|
|
|
|
<section class="prose my-6">
|
|
<p>The example above uses some simple Tailwind CSS along with the <a href="/components/dropdown-menu">Dropdown Menu</a>.</p>
|
|
</section>
|
|
|
|
<h4 class="badge-secondary">HTML</h3>
|
|
|
|
<section class="my-6">
|
|
{{ code_block(code_html | prettyHtml) }}
|
|
</section>
|
|
|
|
<h4 class="badge-secondary">Javascript (Alpine.js) for the Dropdown Menu</h3>
|
|
|
|
<section class="my-6">
|
|
{{ code_block(code_script | prettyHtml) }}
|
|
</section> |