Let's build a simple breadcrumbs component with Tailwind CSS
kouliavtsev
Posted on July 27, 2022
Here is an example of creating a simple breadcrumb component with Tailwind CSS.
Add initial HTML.
<nav aria-label="Breadcrumb">
<ul>
<li><a href="/">Home</a></li>
<li><span aria-current="page">Category</span></li>
</ul>
</nav>
Add three lines of CSS code.
<nav aria-label="Breadcrumb">
<ul className="flex">
<li className="after:content-['/'] after:px-2">
<a href="/" className="underline">
Home
</a>
</li>
<li>
<span aria-current="page">Category</span>
</li>
</ul>
</nav>
And you got yourself some breadcrumbs!
💖 💪 🙅 🚩
kouliavtsev
Posted on July 27, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
tailwindcss How to Make Parent Div Activate Styling of Child Div for Hover and Active States
July 5, 2024
tailwindcss How to Vertically Align Content with Tailwind CSS Across a Full-Screen Div
June 30, 2024