Breadcrumb
Tailwind CSS and Alpine JS Breadcrumb
Breadcrumbs are a great way to display the current location of a user within a website. They can be used to indicate the current page, the parent page, and more.
Breadcrumb with chevron
HTML
<nav class="" aria-label="breadcrumb">
<ol class="">
<li class="">
<a href="#" class="">Home</a>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true" stroke-width="2" stroke="currentColor" class="">
<path stroke-linecap="round" stroke-linejoin="round" d="m8.25 4.5 7.5 7.5-7.5 7.5" />
</svg>
</li>
<li class="">
<a href="#" class="">Components</a>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true" stroke-width="2" stroke="currentColor" class="">
<path stroke-linecap="round" stroke-linejoin="round" d="m8.25 4.5 7.5 7.5-7.5 7.5" />
</svg>
</li>
<li class="" aria-current="page">Breadcrumb</li>
</ol>
</nav>
Breadcrumb with slash
HTML
<nav class="" aria-label="breadcrumb">
<ol class="">
<li class="">
<a href="#" class="">Home</a>
<span aria-hidden="true">/</span>
</li>
<li class="">
<a href="#" class="">Components</a>
<span aria-hidden="true">/</span>
</li>
<li class="" aria-current="page">Breadcrumb</li>
</ol>
</nav>
Breadcrumb with icon
HTML
<nav class="" aria-label="breadcrumb">
<ol class="">
<li class="">
<a href="#" aira-label="home" class="">
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20" aria-hidden="true" class="">
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.293 2.293a1 1 0 0 1 1.414 0l7 7A1 1 0 0 1 17 11h-1v6a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-6H3a1 1 0 0 1-.707-1.707l7-7Z" />
</svg>
</a>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true" stroke-width="2" stroke="currentColor" class="">
<path stroke-linecap="round" stroke-linejoin="round" d="m8.25 4.5 7.5 7.5-7.5 7.5" />
</svg>
</li>
<li class="">
<a href="#" class="">Components</a>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true" stroke-width="2" stroke="currentColor" class="">
<path stroke-linecap="round" stroke-linejoin="round" d="m8.25 4.5 7.5 7.5-7.5 7.5" />
</svg>
</li>
<li class="" aria-current="page">Breadcrumb</li>
</ol>
</nav>
Keyboard Navigation
Key | Action |
---|---|
Tab |
Next focusable element gets the focus |
Space | Focused item gets selected |