Files
WRNexusJSDoc/app/pages/components/breadcrumbs.wrn
T

129 lines
8.8 KiB
Plaintext

page Breadcrumbscomponent {
seo {
title = "Breadcrumbs component"
description = "Reusable breadcrumbs component."
}
view {
<div class="docs-shell">
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
<header class="topbar">
<a class="brand" href="/"><span>W</span> WRNexusJS</a>
<nav aria-label="Primary"><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="/components">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.3.1</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
</header>
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="/components">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
<main class="portal-main docs-layout component-detail-page"><article id="main" class="documentation prose standalone"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/components">Components</a><span>/</span><span aria-current="page">Breadcrumbs</span></nav><section class="doc-intro"><span class="eyebrow">core component</span><h1>Breadcrumbs</h1><p>Reusable breadcrumbs component.</p><div class="doc-meta"><span>@wrnexus/ui 0.3.1</span><span>7 props</span><span>0 slots</span><span>0 events</span></div></section><section id="usage"><h2>Usage</h2><p>Components are auto-discovered. Use the component directly in any <code>.wrn</code> view:</p><pre data-language="wrn"><code>&lt;Breadcrumbs
items=&quot;[]&quot;
centered=&quot;false&quot;
compact=&quot;false&quot;
showHome=&quot;true&quot;
homeLabel=&quot;Home&quot;
/&gt;</code></pre><p>Legacy mount name: <code>data-component=&quot;Breadcrumbs&quot;</code>.</p></section><section id="props"><h2>Props and attributes</h2><div class="table-wrap"><table><thead><tr><th>Prop</th><th>Type</th><th>Requirement</th><th>Default</th></tr></thead><tbody><tr><td><code>class</code></td><td><code>string</code></td><td>Optional</td><td><code>&quot;&quot;</code></td></tr><tr><td><code>items</code></td><td><code>string</code></td><td>Optional</td><td><code>[]</code></td></tr><tr><td><code>centered</code></td><td><code>boolean</code></td><td>Optional</td><td><code>false</code></td></tr><tr><td><code>compact</code></td><td><code>boolean</code></td><td>Optional</td><td><code>false</code></td></tr><tr><td><code>showHome</code></td><td><code>boolean</code></td><td>Optional</td><td><code>true</code></td></tr><tr><td><code>homeLabel</code></td><td><code>string</code></td><td>Optional</td><td><code>&quot;Home&quot;</code></td></tr><tr><td><code>homeHref</code></td><td><code>string</code></td><td>Optional</td><td><code>&quot;/&quot;</code></td></tr></tbody></table></div></section><section id="slots"><h2>Slots</h2><p>This component does not declare a slot.</p></section><section id="events"><h2>Events</h2><p>This component does not declare a custom event.</p></section><section id="source"><h2>Source contract</h2><p>Installed source: <code>components/Breadcrumbs.wrn</code></p><pre data-language="wrn"><code>component Breadcrumbs &#123;
props &#123;
class: string = &quot;&quot;
items = []
centered = false
compact = false
showHome = true
homeLabel = &quot;Home&quot;
homeHref = &quot;/&quot;
&#125;
view &#123;
&lt;nav
aria-label=&quot;Breadcrumb&quot;
class=&quot;w-full &#123;class&#125;&quot;
class:hidden=&quot;items.length === 0 &amp;&amp; !showHome&quot;
&gt;
&lt;ol
class=&quot;flex flex-wrap items-center text-slate-500 dark:text-slate-400&quot;
class:justify-center=&quot;centered&quot;
class:gap-1.5=&quot;compact&quot;
class:text-xs=&quot;compact&quot;
class:gap-2=&quot;!compact&quot;
class:text-sm=&quot;!compact&quot;
&gt;
&lt;!-- Home --&gt;
&lt;li
class:hidden=&quot;!showHome&quot;
class:inline-flex=&quot;showHome&quot;
&gt;
&lt;a
href=&quot;&#123;homeHref&#125;&quot;
class=&quot;group inline-flex items-center gap-1.5 rounded-lg transition hover:text-indigo-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 dark:hover:text-indigo-300&quot;
&gt;
&lt;span class=&quot;icon-[lucide--home] h-3.5 w-3.5&quot; aria-hidden=&quot;true&quot; &gt;
&lt;/span&gt;
&lt;span class:hidden=&quot;compact&quot;&gt;
&#123;homeLabel&#125;
&lt;/span&gt;
&lt;span
class=&quot;sr-only&quot;
class:hidden=&quot;!compact&quot;
&gt;
&#123;homeLabel&#125;
&lt;/span&gt;
&lt;/a&gt;
&lt;/li&gt;
&lt;!-- Separator after home --&gt;
&lt;li
aria-hidden=&quot;true&quot;
class=&quot;text-slate-300 dark:text-slate-700&quot;
class:hidden=&quot;!showHome || items.length === 0&quot;
class:inline-flex=&quot;showHome &amp;&amp; items.length &gt; 0&quot;
&gt;
&lt;span class=&quot;icon-[lucide--chevron-right] h-3.5 w-3.5&quot; &gt;
&lt;/span&gt;
&lt;/li&gt;
&lt;!-- Dynamic breadcrumb items --&gt;
&#123;#each items as item, index&#125;
&lt;li class=&quot;inline-flex min-w-0 items-center gap-2&quot;&gt;
&lt;!-- Linked item --&gt;
&lt;a
href=&quot;&#123;item.href&#125;&quot;
class=&quot;max-w-48 truncate rounded-lg transition hover:text-indigo-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 dark:hover:text-indigo-300 sm:max-w-64&quot;
class:hidden=&quot;item.current || item.href === ''&quot;
class:inline-flex=&quot;!item.current &amp;&amp; item.href !== ''&quot;
&gt;
&#123;item.label&#125;
&lt;/a&gt;
&lt;!-- Current item --&gt;
&lt;span
aria-current=&quot;page&quot;
class=&quot;max-w-48 truncate font-semibold text-slate-950 dark:text-white sm:max-w-64&quot;
class:hidden=&quot;!item.current&quot;
class:inline-flex=&quot;item.current&quot;
&gt;
&#123;item.label&#125;
&lt;/span&gt;
&lt;!-- Plain unlinked item --&gt;
&lt;span
class=&quot;max-w-48 truncate text-slate-600 dark:text-slate-300 sm:max-w-64&quot;
class:hidden=&quot;item.current || item.href !== ''&quot;
class:inline-flex=&quot;!item.current &amp;&amp; item.href === ''&quot;
&gt;
&#123;item.label&#125;
&lt;/span&gt;
&lt;!-- Separator --&gt;
&lt;span
aria-hidden=&quot;true&quot;
class=&quot;inline-flex text-slate-300 dark:text-slate-700&quot;
class:hidden=&quot;index === items.length - 1&quot;
&gt;
&lt;span class=&quot;icon-[lucide--chevron-right] h-3.5 w-3.5&quot; &gt;
&lt;/span&gt;
&lt;/span&gt;
&lt;/li&gt;
&#123;/each&#125;
&lt;/ol&gt;
&lt;/nav&gt;
&#125;
&#125;
</code></pre></section></article><aside class="on-this-page"><h2>On this page</h2><nav><a href="#usage">Usage</a><a href="#props">Props and attributes</a><a href="#slots">Slots</a><a href="#events">Events</a><a href="#source">Source contract</a></nav></aside></main>
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.3.1</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
<BackToTop />
</div>
}
}